5 #ifndef V8_ARM64_CONSTANTS_ARM64_H_
6 #define V8_ARM64_CONSTANTS_ARM64_H_
18 #ifndef __STDC_FORMAT_MACROS
19 #define __STDC_FORMAT_MACROS
117 #define REGISTER_CODE_LIST(R) \
118 R(0) R(1) R(2) R(3) R(4) R(5) R(6) R(7) \
119 R(8) R(9) R(10) R(11) R(12) R(13) R(14) R(15) \
120 R(16) R(17) R(18) R(19) R(20) R(21) R(22) R(23) \
121 R(24) R(25) R(26) R(27) R(28) R(29) R(30) R(31)
123 #define INSTRUCTION_FIELDS_LIST(V_) \
127 V_(Rm, 20, 16, Bits) \
128 V_(Ra, 14, 10, Bits) \
130 V_(Rt2, 14, 10, Bits) \
132 V_(PrefetchMode, 4, 0, Bits) \
135 V_(SixtyFourBits, 31, 31, Bits) \
136 V_(FlagsUpdate, 29, 29, Bits) \
139 V_(ImmPCRelHi, 23, 5, SignedBits) \
140 V_(ImmPCRelLo, 30, 29, Bits) \
143 V_(ShiftDP, 23, 22, Bits) \
144 V_(ImmDPShift, 15, 10, Bits) \
147 V_(ImmAddSub, 21, 10, Bits) \
148 V_(ShiftAddSub, 23, 22, Bits) \
151 V_(ImmExtendShift, 12, 10, Bits) \
152 V_(ExtendMode, 15, 13, Bits) \
155 V_(ImmMoveWide, 20, 5, Bits) \
156 V_(ShiftMoveWide, 22, 21, Bits) \
159 V_(BitN, 22, 22, Bits) \
160 V_(ImmRotate, 21, 16, Bits) \
161 V_(ImmSetBits, 15, 10, Bits) \
162 V_(ImmR, 21, 16, Bits) \
163 V_(ImmS, 15, 10, Bits) \
166 V_(ImmTestBranch, 18, 5, SignedBits) \
167 V_(ImmTestBranchBit40, 23, 19, Bits) \
168 V_(ImmTestBranchBit5, 31, 31, Bits) \
171 V_(Condition, 15, 12, Bits) \
172 V_(ConditionBranch, 3, 0, Bits) \
173 V_(Nzcv, 3, 0, Bits) \
174 V_(ImmCondCmp, 20, 16, Bits) \
175 V_(ImmCondBranch, 23, 5, SignedBits) \
178 V_(FPType, 23, 22, Bits) \
179 V_(ImmFP, 20, 13, Bits) \
180 V_(FPScale, 15, 10, Bits) \
183 V_(ImmLS, 20, 12, SignedBits) \
184 V_(ImmLSUnsigned, 21, 10, Bits) \
185 V_(ImmLSPair, 21, 15, SignedBits) \
186 V_(SizeLS, 31, 30, Bits) \
187 V_(ImmShiftLS, 12, 12, Bits) \
190 V_(ImmUncondBranch, 25, 0, SignedBits) \
191 V_(ImmCmpBranch, 23, 5, SignedBits) \
192 V_(ImmLLiteral, 23, 5, SignedBits) \
193 V_(ImmException, 20, 5, Bits) \
194 V_(ImmHint, 11, 5, Bits) \
195 V_(ImmBarrierDomain, 11, 10, Bits) \
196 V_(ImmBarrierType, 9, 8, Bits) \
199 V_(ImmSystemRegister, 19, 5, Bits) \
200 V_(SysO0, 19, 19, Bits) \
201 V_(SysOp1, 18, 16, Bits) \
202 V_(SysOp2, 7, 5, Bits) \
203 V_(CRn, 15, 12, Bits) \
204 V_(CRm, 11, 8, Bits) \
207 #define SYSTEM_REGISTER_FIELDS_LIST(V_, M_) \
209 V_(Flags, 31, 28, Bits, uint32_t) \
210 V_(N, 31, 31, Bits, bool) \
211 V_(Z, 30, 30, Bits, bool) \
212 V_(C, 29, 29, Bits, bool) \
213 V_(V, 28, 28, Bits, uint32_t) \
214 M_(NZCV, Flags_mask) \
217 V_(AHP, 26, 26, Bits, bool) \
218 V_(DN, 25, 25, Bits, bool) \
219 V_(FZ, 24, 24, Bits, bool) \
220 V_(RMode, 23, 22, Bits, FPRounding) \
221 M_(FPCR, AHP_mask | DN_mask | FZ_mask | RMode_mask)
225 #define DECLARE_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1, unused_2) \
226 const int Name##_offset = LowBit; \
227 const int Name##_width = HighBit - LowBit + 1; \
228 const uint32_t Name##_mask = ((1 << Name##_width) - 1) << LowBit;
229 #define DECLARE_INSTRUCTION_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1) \
230 DECLARE_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1, unused_2)
231 #define NOTHING(A, B)
235 #undef DECLARE_FIELDS_OFFSETS
236 #undef DECLARE_INSTRUCTION_FIELDS_OFFSETS
379 NZCV = ((0x1 << SysO0_offset) |
380 (0x3 << SysOp1_offset) |
381 (0x4 << CRn_offset) |
382 (0x2 << CRm_offset) |
383 (0x0 << SysOp2_offset)) >> ImmSystemRegister_offset,
384 FPCR = ((0x1 << SysO0_offset) |
385 (0x3 << SysOp1_offset) |
386 (0x4 << CRn_offset) |
387 (0x4 << CRm_offset) |
388 (0x0 << SysOp2_offset)) >> ImmSystemRegister_offset
439 #define ADD_SUB_OP_LIST(V) \
449 #define ADD_SUB_IMMEDIATE(A) \
450 A##_w_imm = AddSubImmediateFixed | A, \
451 A##_x_imm = AddSubImmediateFixed | A | SixtyFourBits
453 #undef ADD_SUB_IMMEDIATE
460 #define ADD_SUB_SHIFTED(A) \
461 A##_w_shift = AddSubShiftedFixed | A, \
462 A##_x_shift = AddSubShiftedFixed | A | SixtyFourBits
464 #undef ADD_SUB_SHIFTED
471 #define ADD_SUB_EXTENDED(A) \
472 A##_w_ext = AddSubExtendedFixed | A, \
473 A##_x_ext = AddSubExtendedFixed | A | SixtyFourBits
475 #undef ADD_SUB_EXTENDED
712 #define LOAD_STORE_PAIR_OP_LIST(V) \
713 V(STP, w, 0x00000000), \
714 V(LDP, w, 0x00400000), \
715 V(LDPSW, x, 0x40400000), \
716 V(STP, x, 0x80000000), \
717 V(LDP, x, 0x80400000), \
718 V(STP, s, 0x04000000), \
719 V(LDP, s, 0x04400000), \
720 V(STP, d, 0x44000000), \
721 V(LDP, d, 0x44400000)
727 #define LOAD_STORE_PAIR(A, B, C) \
730 #undef LOAD_STORE_PAIR
737 #define LOAD_STORE_PAIR_POST_INDEX(A, B, C) \
738 A##_##B##_post = LoadStorePairPostIndexFixed | A##_##B
740 #undef LOAD_STORE_PAIR_POST_INDEX
747 #define LOAD_STORE_PAIR_PRE_INDEX(A, B, C) \
748 A##_##B##_pre = LoadStorePairPreIndexFixed | A##_##B
750 #undef LOAD_STORE_PAIR_PRE_INDEX
757 #define LOAD_STORE_PAIR_OFFSET(A, B, C) \
758 A##_##B##_off = LoadStorePairOffsetFixed | A##_##B
760 #undef LOAD_STORE_PAIR_OFFSET
790 #define LOAD_STORE_OP_LIST(V) \
791 V(ST, RB, w, 0x00000000), \
792 V(ST, RH, w, 0x40000000), \
793 V(ST, R, w, 0x80000000), \
794 V(ST, R, x, 0xC0000000), \
795 V(LD, RB, w, 0x00400000), \
796 V(LD, RH, w, 0x40400000), \
797 V(LD, R, w, 0x80400000), \
798 V(LD, R, x, 0xC0400000), \
799 V(LD, RSB, x, 0x00800000), \
800 V(LD, RSH, x, 0x40800000), \
801 V(LD, RSW, x, 0x80800000), \
802 V(LD, RSB, w, 0x00C00000), \
803 V(LD, RSH, w, 0x40C00000), \
804 V(ST, R, s, 0x84000000), \
805 V(ST, R, d, 0xC4000000), \
806 V(LD, R, s, 0x84400000), \
807 V(LD, R, d, 0xC4400000)
815 #define LOAD_STORE_UNSCALED(A, B, C, D) \
816 A##U##B##_##C = LoadStoreUnscaledOffsetFixed | D
818 #undef LOAD_STORE_UNSCALED
824 #define LOAD_STORE(A, B, C, D) \
836 #define LOAD_STORE_POST_INDEX(A, B, C, D) \
837 A##B##_##C##_post = LoadStorePostIndexFixed | D
839 #undef LOAD_STORE_POST_INDEX
847 #define LOAD_STORE_PRE_INDEX(A, B, C, D) \
848 A##B##_##C##_pre = LoadStorePreIndexFixed | D
850 #undef LOAD_STORE_PRE_INDEX
859 #define LOAD_STORE_UNSIGNED_OFFSET(A, B, C, D) \
860 A##B##_##C##_unsigned = LoadStoreUnsignedOffsetFixed | D
862 #undef LOAD_STORE_UNSIGNED_OFFSET
871 #define LOAD_STORE_REGISTER_OFFSET(A, B, C, D) \
872 A##B##_##C##_reg = LoadStoreRegisterOffsetFixed | D
874 #undef LOAD_STORE_REGISTER_OFFSET
#define ADD_SUB_OP_LIST(V)
#define ADD_SUB_IMMEDIATE(A)
#define LOAD_STORE_UNSCALED(A, B, C, D)
STATIC_ASSERT(sizeof(int)==sizeof(int32_t))
#define LOAD_STORE_PAIR_PRE_INDEX(A, B, C)
#define LOAD_STORE_POST_INDEX(A, B, C, D)
#define INSTRUCTION_FIELDS_LIST(V_)
#define LOAD_STORE_PAIR_OP_LIST(V)
#define LOAD_STORE_PAIR_POST_INDEX(A, B, C)
#define LOAD_STORE(A, B, C, D)
#define LOAD_STORE_REGISTER_OFFSET(A, B, C, D)
#define DECLARE_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1, unused_2)
#define SYSTEM_REGISTER_FIELDS_LIST(V_, M_)
#define LOAD_STORE_UNSIGNED_OFFSET(A, B, C, D)
#define LOAD_STORE_PAIR(A, B, C)
#define ADD_SUB_SHIFTED(A)
#define DECLARE_INSTRUCTION_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1)
#define LOAD_STORE_PAIR_OFFSET(A, B, C)
#define LOAD_STORE_PRE_INDEX(A, B, C, D)
#define ADD_SUB_EXTENDED(A)
#define DCHECK(condition)
const int kBitfieldNOffset
const int kNumberOfCalleeSavedFPRegisters
const unsigned kWRegSizeLog2
@ UnconditionalBranchFMask
@ UnconditionalBranchMask
@ UnconditionalBranchFixed
const unsigned kQuadWordSize
@ DataProcessing1SourceFixed
@ DataProcessing1SourceFMask
@ DataProcessing1SourceMask
Condition CommuteCondition(Condition cond)
FPDataProcessing2SourceOp
@ FPDataProcessing2SourceMask
@ FPDataProcessing2SourceFixed
@ FPDataProcessing2SourceFMask
const unsigned kDRegSizeInBits
const unsigned kMaxLoadLiteralRange
const unsigned kQuadWordSizeInBytes
const int64_t kDQuietNanBit
const unsigned kXRegSizeInBits
LoadStorePairNonTemporalOp
@ LoadStorePairNonTemporalFixed
@ LoadStorePairNonTemporalMask
@ LoadStorePairNonTemporalFMask
const unsigned kShiftAmountXRegMask
const unsigned kHalfWordSizeInBytesLog2
const int kFirstCalleeSavedFPRegisterIndex
@ LoadStorePairPreIndexMask
@ LoadStorePairPreIndexFMask
@ LoadStorePairPreIndexFixed
const unsigned kSPRegInternalCode
const unsigned kXRegSizeInBitsLog2
const unsigned kShiftAmountWRegMask
@ FPFixedPointConvertMask
@ FPFixedPointConvertFMask
@ FPFixedPointConvertFixed
LoadStoreUnscaledOffsetOp
@ LoadStoreUnscaledOffsetFMask
@ LoadStoreUnscaledOffsetFixed
@ LoadStoreUnscaledOffsetMask
const unsigned kWRegSizeInBits
const unsigned kDRegSizeInBitsLog2
FPDataProcessing3SourceOp
@ FPDataProcessing3SourceFMask
@ FPDataProcessing3SourceMask
@ FPDataProcessing3SourceFixed
const unsigned kSRegSizeInBits
@ LoadStoreUnsignedOffsetMask
@ LoadStoreUnsignedOffsetFixed
@ LoadStoreUnsignedOffsetFMask
FPDataProcessing1SourceOp
@ FPDataProcessing1SourceFMask
@ FPDataProcessing1SourceFixed
@ FPDataProcessing1SourceMask
const unsigned kSRegSizeLog2
const unsigned kNumberOfFPRegisters
const unsigned kDoubleMantissaBits
const unsigned kLoadLiteralScaleLog2
const int64_t kHalfWordMask
const unsigned kWRegSizeInBitsLog2
const unsigned kDoubleExponentBias
@ LoadStorePairOffsetMask
@ LoadStorePairOffsetFixed
@ LoadStorePairOffsetFMask
const unsigned kRegCodeMask
const unsigned kWordSizeInBytesLog2
const int64_t kDQuietNanMask
Condition NegateCondition(Condition cond)
const unsigned kSRegSizeInBitsLog2
const unsigned kWordSizeLog2
@ DataProcessing3SourceFMask
@ DataProcessing3SourceMask
@ DataProcessing3SourceFixed
const unsigned kXRegSizeLog2
const unsigned kFramePointerRegCode
@ DataProcessing2SourceMask
@ DataProcessing2SourceFMask
@ DataProcessing2SourceFixed
const unsigned kDoubleExponentBits
const unsigned kFloatMantissaBits
const int kNumberOfCalleeSavedRegisters
const int64_t kSQuietNanMask
const unsigned kDRegSizeLog2
@ FPConditionalSelectFMask
@ FPConditionalSelectMask
@ FPConditionalSelectFixed
const unsigned kZeroRegCode
const unsigned kHalfWordSizeLog2
const unsigned kWordSizeInBytes
const int kFirstCalleeSavedRegisterIndex
const unsigned kFloatExponentBits
const unsigned kJSCalleeSavedRegList
const unsigned kNumberOfRegisters
const unsigned kByteSizeInBytes
const unsigned kHalfWordSize
@ FPConditionalCompareMask
@ FPConditionalCompareFixed
@ FPConditionalCompareFMask
const int64_t kSQuietNanBit
@ LoadStoreRegisterOffsetFixed
@ LoadStoreRegisterOffsetFMask
@ LoadStoreRegisterOffsetMask
const unsigned kDoubleWordSize
const unsigned kInstructionSize
@ LoadStorePostIndexFMask
@ LoadStorePostIndexFixed
const unsigned kLinkRegCode
ConditionalCompareImmediateOp
@ ConditionalCompareImmediateFixed
@ ConditionalCompareImmediateMask
@ ConditionalCompareImmediateFMask
const unsigned kInstructionSizeLog2
ConditionalCompareRegisterOp
@ ConditionalCompareRegisterFMask
@ ConditionalCompareRegisterMask
@ ConditionalCompareRegisterFixed
UnconditionalBranchToRegisterOp
@ UnconditionalBranchToRegisterMask
@ UnconditionalBranchToRegisterFixed
@ UnconditionalBranchToRegisterFMask
const unsigned kHalfWordSizeInBytes
const unsigned kDoubleWordSizeInBytes
@ LoadStorePairPostIndexFixed
@ LoadStorePairPostIndexFMask
@ LoadStorePairPostIndexMask
Debugger support for the V8 JavaScript engine.