28 #ifndef V8_ARM64_CONSTANTS_ARM64_H_
29 #define V8_ARM64_CONSTANTS_ARM64_H_
41 #define __STDC_FORMAT_MACROS
136 #define REGISTER_CODE_LIST(R) \
137 R(0) R(1) R(2) R(3) R(4) R(5) R(6) R(7) \
138 R(8) R(9) R(10) R(11) R(12) R(13) R(14) R(15) \
139 R(16) R(17) R(18) R(19) R(20) R(21) R(22) R(23) \
140 R(24) R(25) R(26) R(27) R(28) R(29) R(30) R(31)
142 #define INSTRUCTION_FIELDS_LIST(V_) \
146 V_(Rm, 20, 16, Bits) \
147 V_(Ra, 14, 10, Bits) \
149 V_(Rt2, 14, 10, Bits) \
151 V_(PrefetchMode, 4, 0, Bits) \
154 V_(SixtyFourBits, 31, 31, Bits) \
155 V_(FlagsUpdate, 29, 29, Bits) \
158 V_(ImmPCRelHi, 23, 5, SignedBits) \
159 V_(ImmPCRelLo, 30, 29, Bits) \
162 V_(ShiftDP, 23, 22, Bits) \
163 V_(ImmDPShift, 15, 10, Bits) \
166 V_(ImmAddSub, 21, 10, Bits) \
167 V_(ShiftAddSub, 23, 22, Bits) \
170 V_(ImmExtendShift, 12, 10, Bits) \
171 V_(ExtendMode, 15, 13, Bits) \
174 V_(ImmMoveWide, 20, 5, Bits) \
175 V_(ShiftMoveWide, 22, 21, Bits) \
178 V_(BitN, 22, 22, Bits) \
179 V_(ImmRotate, 21, 16, Bits) \
180 V_(ImmSetBits, 15, 10, Bits) \
181 V_(ImmR, 21, 16, Bits) \
182 V_(ImmS, 15, 10, Bits) \
185 V_(ImmTestBranch, 18, 5, SignedBits) \
186 V_(ImmTestBranchBit40, 23, 19, Bits) \
187 V_(ImmTestBranchBit5, 31, 31, Bits) \
190 V_(Condition, 15, 12, Bits) \
191 V_(ConditionBranch, 3, 0, Bits) \
192 V_(Nzcv, 3, 0, Bits) \
193 V_(ImmCondCmp, 20, 16, Bits) \
194 V_(ImmCondBranch, 23, 5, SignedBits) \
197 V_(FPType, 23, 22, Bits) \
198 V_(ImmFP, 20, 13, Bits) \
199 V_(FPScale, 15, 10, Bits) \
202 V_(ImmLS, 20, 12, SignedBits) \
203 V_(ImmLSUnsigned, 21, 10, Bits) \
204 V_(ImmLSPair, 21, 15, SignedBits) \
205 V_(SizeLS, 31, 30, Bits) \
206 V_(ImmShiftLS, 12, 12, Bits) \
209 V_(ImmUncondBranch, 25, 0, SignedBits) \
210 V_(ImmCmpBranch, 23, 5, SignedBits) \
211 V_(ImmLLiteral, 23, 5, SignedBits) \
212 V_(ImmException, 20, 5, Bits) \
213 V_(ImmHint, 11, 5, Bits) \
214 V_(ImmBarrierDomain, 11, 10, Bits) \
215 V_(ImmBarrierType, 9, 8, Bits) \
218 V_(ImmSystemRegister, 19, 5, Bits) \
219 V_(SysO0, 19, 19, Bits) \
220 V_(SysOp1, 18, 16, Bits) \
221 V_(SysOp2, 7, 5, Bits) \
222 V_(CRn, 15, 12, Bits) \
223 V_(CRm, 11, 8, Bits) \
226 #define SYSTEM_REGISTER_FIELDS_LIST(V_, M_) \
228 V_(Flags, 31, 28, Bits, uint32_t) \
229 V_(N, 31, 31, Bits, bool) \
230 V_(Z, 30, 30, Bits, bool) \
231 V_(C, 29, 29, Bits, bool) \
232 V_(V, 28, 28, Bits, uint32_t) \
233 M_(NZCV, Flags_mask) \
236 V_(AHP, 26, 26, Bits, bool) \
237 V_(DN, 25, 25, Bits, bool) \
238 V_(FZ, 24, 24, Bits, bool) \
239 V_(RMode, 23, 22, Bits, FPRounding) \
240 M_(FPCR, AHP_mask | DN_mask | FZ_mask | RMode_mask)
244 #define DECLARE_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1, unused_2) \
245 const int Name##_offset = LowBit; \
246 const int Name##_width = HighBit - LowBit + 1; \
247 const uint32_t Name##_mask = ((1 << Name##_width) - 1) << LowBit;
248 #define DECLARE_INSTRUCTION_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1) \
249 DECLARE_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1, unused_2)
250 #define NOTHING(A, B)
254 #undef DECLARE_FIELDS_OFFSETS
255 #undef DECLARE_INSTRUCTION_FIELDS_OFFSETS
398 NZCV = ((0x1 << SysO0_offset) |
399 (0x3 << SysOp1_offset) |
400 (0x4 << CRn_offset) |
401 (0x2 << CRm_offset) |
402 (0x0 << SysOp2_offset)) >> ImmSystemRegister_offset,
403 FPCR = ((0x1 << SysO0_offset) |
404 (0x3 << SysOp1_offset) |
405 (0x4 << CRn_offset) |
406 (0x4 << CRm_offset) |
407 (0x0 << SysOp2_offset)) >> ImmSystemRegister_offset
458 #define ADD_SUB_OP_LIST(V) \
468 #define ADD_SUB_IMMEDIATE(A) \
469 A##_w_imm = AddSubImmediateFixed | A, \
470 A##_x_imm = AddSubImmediateFixed | A | SixtyFourBits
472 #undef ADD_SUB_IMMEDIATE
479 #define ADD_SUB_SHIFTED(A) \
480 A##_w_shift = AddSubShiftedFixed | A, \
481 A##_x_shift = AddSubShiftedFixed | A | SixtyFourBits
483 #undef ADD_SUB_SHIFTED
490 #define ADD_SUB_EXTENDED(A) \
491 A##_w_ext = AddSubExtendedFixed | A, \
492 A##_x_ext = AddSubExtendedFixed | A | SixtyFourBits
494 #undef ADD_SUB_EXTENDED
731 #define LOAD_STORE_PAIR_OP_LIST(V) \
732 V(STP, w, 0x00000000), \
733 V(LDP, w, 0x00400000), \
734 V(LDPSW, x, 0x40400000), \
735 V(STP, x, 0x80000000), \
736 V(LDP, x, 0x80400000), \
737 V(STP, s, 0x04000000), \
738 V(LDP, s, 0x04400000), \
739 V(STP, d, 0x44000000), \
740 V(LDP, d, 0x44400000)
746 #define LOAD_STORE_PAIR(A, B, C) \
749 #undef LOAD_STORE_PAIR
756 #define LOAD_STORE_PAIR_POST_INDEX(A, B, C) \
757 A##_##B##_post = LoadStorePairPostIndexFixed | A##_##B
759 #undef LOAD_STORE_PAIR_POST_INDEX
766 #define LOAD_STORE_PAIR_PRE_INDEX(A, B, C) \
767 A##_##B##_pre = LoadStorePairPreIndexFixed | A##_##B
769 #undef LOAD_STORE_PAIR_PRE_INDEX
776 #define LOAD_STORE_PAIR_OFFSET(A, B, C) \
777 A##_##B##_off = LoadStorePairOffsetFixed | A##_##B
779 #undef LOAD_STORE_PAIR_OFFSET
809 #define LOAD_STORE_OP_LIST(V) \
810 V(ST, RB, w, 0x00000000), \
811 V(ST, RH, w, 0x40000000), \
812 V(ST, R, w, 0x80000000), \
813 V(ST, R, x, 0xC0000000), \
814 V(LD, RB, w, 0x00400000), \
815 V(LD, RH, w, 0x40400000), \
816 V(LD, R, w, 0x80400000), \
817 V(LD, R, x, 0xC0400000), \
818 V(LD, RSB, x, 0x00800000), \
819 V(LD, RSH, x, 0x40800000), \
820 V(LD, RSW, x, 0x80800000), \
821 V(LD, RSB, w, 0x00C00000), \
822 V(LD, RSH, w, 0x40C00000), \
823 V(ST, R, s, 0x84000000), \
824 V(ST, R, d, 0xC4000000), \
825 V(LD, R, s, 0x84400000), \
826 V(LD, R, d, 0xC4400000)
834 #define LOAD_STORE_UNSCALED(A, B, C, D) \
835 A##U##B##_##C = LoadStoreUnscaledOffsetFixed | D
837 #undef LOAD_STORE_UNSCALED
843 #define LOAD_STORE(A, B, C, D) \
855 #define LOAD_STORE_POST_INDEX(A, B, C, D) \
856 A##B##_##C##_post = LoadStorePostIndexFixed | D
858 #undef LOAD_STORE_POST_INDEX
866 #define LOAD_STORE_PRE_INDEX(A, B, C, D) \
867 A##B##_##C##_pre = LoadStorePreIndexFixed | D
869 #undef LOAD_STORE_PRE_INDEX
878 #define LOAD_STORE_UNSIGNED_OFFSET(A, B, C, D) \
879 A##B##_##C##_unsigned = LoadStoreUnsignedOffsetFixed | D
881 #undef LOAD_STORE_UNSIGNED_OFFSET
890 #define LOAD_STORE_REGISTER_OFFSET(A, B, C, D) \
891 A##B##_##C##_reg = LoadStoreRegisterOffsetFixed | D
893 #undef LOAD_STORE_REGISTER_OFFSET
1271 #endif // V8_ARM64_CONSTANTS_ARM64_H_
const unsigned kInstructionSizeLog2
const unsigned kFloatExponentBits
const int64_t kDQuietNanMask
const unsigned kDRegSizeInBits
#define INSTRUCTION_FIELDS_LIST(V_)
const unsigned kHalfWordSizeLog2
const unsigned kZeroRegCode
const unsigned kWRegSizeInBitsLog2
const int64_t kSQuietNanMask
const unsigned kByteSizeInBytes
const unsigned kLiteralEntrySizeLog2
const unsigned kXRegSizeInBits
const unsigned kQuadWordSize
#define ADD_SUB_SHIFTED(A)
const unsigned kDRegSizeInBitsLog2
const int kFirstCalleeSavedFPRegisterIndex
FPDataProcessing2SourceOp
#define ASSERT(condition)
#define LOAD_STORE_PAIR_OP_LIST(V)
const unsigned kLiteralEntrySize
ConditionalCompareImmediateOp
const unsigned kDoubleWordSizeInBytes
const unsigned kLinkRegCode
#define LOAD_STORE_POST_INDEX(A, B, C, D)
const int kNumberOfCalleeSavedRegisters
Condition ReverseConditionForCmp(Condition cond)
const unsigned kXRegSizeInBitsLog2
const unsigned kDoubleWordSize
const unsigned kWordSizeInBytes
const unsigned kWRegSizeInBits
#define LOAD_STORE_REGISTER_OFFSET(A, B, C, D)
const unsigned kSRegSizeInBitsLog2
#define LOAD_STORE(A, B, C, D)
#define LOAD_STORE_UNSIGNED_OFFSET(A, B, C, D)
const unsigned kDoubleExponentBits
const int64_t kSQuietNanBit
Condition InvertCondition(Condition cond)
#define ADD_SUB_EXTENDED(A)
const unsigned kSRegSizeLog2
const int kBitfieldNOffset
#define DECLARE_INSTRUCTION_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1)
const unsigned kDRegSizeLog2
const unsigned kInstructionSize
const unsigned kSRegSizeInBits
const unsigned kFloatMantissaBits
const unsigned kSPRegInternalCode
#define LOAD_STORE_UNSCALED(A, B, C, D)
ConditionalCompareRegisterOp
LoadStorePairNonTemporalOp
const unsigned kNumberOfFPRegisters
const unsigned kHalfWordSize
const unsigned kQuadWordSizeInBytes
FPDataProcessing1SourceOp
#define LOAD_STORE_PAIR_POST_INDEX(A, B, C)
const unsigned kNumberOfRegisters
const unsigned kRegCodeMask
#define ADD_SUB_IMMEDIATE(A)
#define LOAD_STORE_PAIR_OFFSET(A, B, C)
const unsigned kWordSizeLog2
const unsigned kMaxLoadLiteralRange
#define LOAD_STORE_PAIR_PRE_INDEX(A, B, C)
const unsigned kDoubleMantissaBits
#define ADD_SUB_OP_LIST(V)
const unsigned kHalfWordSizeInBytesLog2
FPDataProcessing3SourceOp
UnconditionalBranchToRegisterOp
const unsigned kWordSizeInBytesLog2
STATIC_ASSERT(sizeof(int)==sizeof(int32_t))
const int kNumberOfCalleeSavedFPRegisters
const int64_t kDQuietNanBit
const unsigned kFramePointerRegCode
#define LOAD_STORE_PAIR(A, B, C)
LoadStoreUnscaledOffsetOp
const unsigned kJSCalleeSavedRegList
const int kFirstCalleeSavedRegisterIndex
const unsigned kWRegSizeLog2
const int64_t kHalfWordMask
const unsigned kHalfWordSizeInBytes
const unsigned kXRegSizeLog2
#define LOAD_STORE_PRE_INDEX(A, B, C, D)
#define SYSTEM_REGISTER_FIELDS_LIST(V_, M_)
#define DECLARE_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1, unused_2)