5#ifndef V8_CODEGEN_ARM_REGISTER_ARM_H_
6#define V8_CODEGEN_ARM_REGISTER_ARM_H_
14#define GENERAL_REGISTERS(V) \
15 V(r0) V(r1) V(r2) V(r3) V(r4) V(r5) V(r6) V(r7) \
16 V(r8) V(r9) V(r10) V(fp) V(ip) V(sp) V(lr) V(pc)
18#define ALLOCATABLE_GENERAL_REGISTERS(V) \
19 V(r0) V(r1) V(r2) V(r3) V(r4) V(r5) V(r6) V(r7) \
22#define FLOAT_REGISTERS(V) \
23 V(s0) V(s1) V(s2) V(s3) V(s4) V(s5) V(s6) V(s7) \
24 V(s8) V(s9) V(s10) V(s11) V(s12) V(s13) V(s14) V(s15) \
25 V(s16) V(s17) V(s18) V(s19) V(s20) V(s21) V(s22) V(s23) \
26 V(s24) V(s25) V(s26) V(s27) V(s28) V(s29) V(s30) V(s31)
28#define LOW_DOUBLE_REGISTERS(V) \
29 V(d0) V(d1) V(d2) V(d3) V(d4) V(d5) V(d6) V(d7) \
30 V(d8) V(d9) V(d10) V(d11) V(d12) V(d13) V(d14) V(d15)
32#define NON_LOW_DOUBLE_REGISTERS(V) \
33 V(d16) V(d17) V(d18) V(d19) V(d20) V(d21) V(d22) V(d23) \
34 V(d24) V(d25) V(d26) V(d27) V(d28) V(d29) V(d30) V(d31)
36#define DOUBLE_REGISTERS(V) \
37 LOW_DOUBLE_REGISTERS(V) NON_LOW_DOUBLE_REGISTERS(V)
39#define SIMD128_REGISTERS(V) \
40 V(q0) V(q1) V(q2) V(q3) V(q4) V(q5) V(q6) V(q7) \
41 V(q8) V(q9) V(q10) V(q11) V(q12) V(q13) V(q14) V(q15)
43#define ALLOCATABLE_DOUBLE_REGISTERS(V) \
44 V(d0) V(d1) V(d2) V(d3) V(d4) V(d5) V(d6) V(d7) \
45 V(d8) V(d9) V(d10) V(d11) V(d12) \
46 V(d16) V(d17) V(d18) V(d19) V(d20) V(d21) V(d22) V(d23) \
47 V(d24) V(d25) V(d26) V(d27) V(d28) V(d29) V(d30) V(d31)
49#define ALLOCATABLE_NO_VFP32_DOUBLE_REGISTERS(V) \
50 V(d0) V(d1) V(d2) V(d3) V(d4) V(d5) V(d6) V(d7) \
51 V(d8) V(d9) V(d10) V(d11) V(d12) V(d15)
53#define C_REGISTERS(V) \
54 V(cr0) V(cr1) V(cr2) V(cr3) V(cr4) V(cr5) V(cr6) V(cr7) \
55 V(cr8) V(cr9) V(cr10) V(cr11) V(cr12) V(cr15)
59#define REGISTER_CODE(R) kRegCode_##R,
65class Register :
public RegisterBase<Register, kRegAfterLast> {
72static_assert(
sizeof(
Register) <=
sizeof(int),
73 "Register can efficiently be passed by value");
83#define DECLARE_REGISTER(R) \
84 constexpr Register R = Register::from_code(kRegCode_##R);
86#undef DECLARE_REGISTER
105#define REGISTER_CODE(R) kSwVfpCode_##R,
135 return uint64_t{0x1} <<
code();
145 "SwVfpRegister can efficiently be passed by value");
150#define REGISTER_CODE(R) kDoubleCode_##R,
168 *
m = (reg_code & 0x10) >> 4;
169 *vm = reg_code & 0x0F;
174 return uint64_t{0x3} << (
code() * 2);
185 "DwVfpRegister can efficiently be passed by value");
191 :
public RegisterBase<LowDwVfpRegister, kDoubleCode_d16> {
201 return uint64_t{0x3} << (
code() * 2);
210#define REGISTER_CODE(R) kSimd128Code_##R,
221 int encoded_code = reg_code << 1;
222 *
m = (encoded_code & 0x10) >> 4;
223 *vm = encoded_code & 0x0F;
232 return uint64_t{0xf} << (
code() * 4);
245#define REGISTER_CODE(R) kCCode_##R,
252class CRegister :
public RegisterBase<CRegister, kCAfterLast> {
259#define DECLARE_FLOAT_REGISTER(R) \
260 constexpr SwVfpRegister R = SwVfpRegister::from_code(kSwVfpCode_##R);
262#undef DECLARE_FLOAT_REGISTER
264#define DECLARE_LOW_DOUBLE_REGISTER(R) \
265 constexpr LowDwVfpRegister R = LowDwVfpRegister::from_code(kDoubleCode_##R);
267#undef DECLARE_LOW_DOUBLE_REGISTER
269#define DECLARE_DOUBLE_REGISTER(R) \
270 constexpr DwVfpRegister R = DwVfpRegister::from_code(kDoubleCode_##R);
272#undef DECLARE_DOUBLE_REGISTER
276#define DECLARE_SIMD128_REGISTER(R) \
277 constexpr Simd128Register R = Simd128Register::from_code(kSimd128Code_##R);
279#undef DECLARE_SIMD128_REGISTER
288#define DECLARE_C_REGISTER(R) \
289 constexpr CRegister R = CRegister::from_code(kCCode_##R);
291#undef DECLARE_C_REGISTER
constexpr CRegister(int code)
static constexpr int kSizeInBytes
static void split_code(int reg_code, int *vm, int *m)
static int SupportedRegisterCount()
constexpr DwVfpRegister(int code)
void split_code(int *vm, int *m) const
VfpRegList ToVfpRegList() const
constexpr LowDwVfpRegister(int code)
SwVfpRegister high() const
SwVfpRegister low() const
VfpRegList ToVfpRegList() const
constexpr QwNeonRegister(int code)
void split_code(int *vm, int *m) const
static void split_code(int reg_code, int *vm, int *m)
DwVfpRegister low() const
VfpRegList ToVfpRegList() const
DwVfpRegister high() const
static constexpr int8_t kNumRegisters
constexpr bool is_valid() const
static constexpr SwVfpRegister from_code(int8_t code)
static constexpr DwVfpRegister no_reg()
constexpr int8_t code() const
constexpr Register(int code)
static constexpr Register no_reg()
static void split_code(int reg_code, int *vm, int *m)
constexpr SwVfpRegister(int code)
void split_code(int *vm, int *m) const
VfpRegList ToVfpRegList() const
static constexpr int kSizeInBytes
ZoneVector< RpoNumber > & result
InstructionOperand source
constexpr Register no_reg
constexpr Register kRootRegister
constexpr AliasingKind kFPAliasing
constexpr Register kRuntimeCallFunctionRegister
constexpr Register kRuntimeCallArgvRegister
constexpr Register kJavaScriptCallTargetRegister
constexpr DwVfpRegister no_dreg
constexpr LowDwVfpRegister kLastCalleeSavedDoubleReg
constexpr Register kJavaScriptCallArgCountRegister
constexpr Register kInterpreterAccumulatorRegister
static const int kRegisterPassedArguments
static const int kDoubleRegisterPassedArguments
constexpr DoubleRegister kFPReturnRegister0
constexpr Register kReturnRegister1
constexpr Register kMaglevExtraScratchRegister
constexpr Register kReturnRegister0
constexpr Register kWasmImplicitArgRegister
constexpr Register kContextRegister
constexpr Register kRuntimeCallArgCountRegister
constexpr Register kInterpreterDispatchTableRegister
constexpr Register kAllocateSizeRegister
constexpr LowDwVfpRegister kDoubleRegZero
constexpr Register kJavaScriptCallExtraArg1Register
constexpr Register kJavaScriptCallCodeStartRegister
constexpr Register kReturnRegister2
Register ReassignRegister(Register &source)
constexpr CRegister no_creg
constexpr Register kWasmCompileLazyFuncIndexRegister
constexpr LowDwVfpRegister kFirstCalleeSavedDoubleReg
constexpr Register kStackPointerRegister
constexpr int ArgumentPaddingSlots(int argument_count)
constexpr Register kCArgRegs[]
constexpr bool kSimdMaskRegisters
constexpr Register kJavaScriptCallDispatchHandleRegister
constexpr Register kInterpreterBytecodeOffsetRegister
constexpr Register kJavaScriptCallNewTargetRegister
constexpr Register kJSFunctionRegister
constexpr Register kInterpreterBytecodeArrayRegister
#define DECLARE_FLOAT_REGISTER(R)
#define GENERAL_REGISTERS(V)
#define SIMD128_REGISTERS(V)
#define FLOAT_REGISTERS(V)
#define DECLARE_DOUBLE_REGISTER(R)
#define LOW_DOUBLE_REGISTERS(V)
#define NON_LOW_DOUBLE_REGISTERS(V)
#define DECLARE_C_REGISTER(R)
#define DECLARE_LOW_DOUBLE_REGISTER(R)
#define DECLARE_REGISTER(R)
#define DOUBLE_REGISTERS(V)
#define DECLARE_SIMD128_REGISTER(R)
#define DEFINE_REGISTER_NAMES(RegType, LIST)
#define DCHECK(condition)
#define ASSERT_TRIVIALLY_COPYABLE(T)