1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef V8_ARM64_CONSTANTS_ARM64_H_
6 #define V8_ARM64_CONSTANTS_ARM64_H_
9 // Assert that this is an LP64 system.
10 STATIC_ASSERT(sizeof(int) == sizeof(int32_t)); // NOLINT(runtime/sizeof)
11 STATIC_ASSERT(sizeof(long) == sizeof(int64_t)); // NOLINT(runtime/int)
12 STATIC_ASSERT(sizeof(void *) == sizeof(int64_t)); // NOLINT(runtime/sizeof)
13 STATIC_ASSERT(sizeof(1) == sizeof(int32_t)); // NOLINT(runtime/sizeof)
14 STATIC_ASSERT(sizeof(1L) == sizeof(int64_t)); // NOLINT(runtime/sizeof)
17 // Get the standard printf format macros for C99 stdint types.
18 #define __STDC_FORMAT_MACROS
26 const unsigned kInstructionSize = 4;
27 const unsigned kInstructionSizeLog2 = 2;
28 const unsigned kLiteralEntrySize = 4;
29 const unsigned kLiteralEntrySizeLog2 = 2;
30 const unsigned kMaxLoadLiteralRange = 1 * MB;
32 const unsigned kNumberOfRegisters = 32;
33 const unsigned kNumberOfFPRegisters = 32;
34 // Callee saved registers are x19-x30(lr).
35 const int kNumberOfCalleeSavedRegisters = 11;
36 const int kFirstCalleeSavedRegisterIndex = 19;
37 // Callee saved FP registers are d8-d15.
38 const int kNumberOfCalleeSavedFPRegisters = 8;
39 const int kFirstCalleeSavedFPRegisterIndex = 8;
40 // Callee saved registers with no specific purpose in JS are x19-x25.
41 const unsigned kJSCalleeSavedRegList = 0x03f80000;
42 // TODO(all): k<Y>RegSize should probably be k<Y>RegSizeInBits.
43 const unsigned kWRegSizeInBits = 32;
44 const unsigned kWRegSizeInBitsLog2 = 5;
45 const unsigned kWRegSize = kWRegSizeInBits >> 3;
46 const unsigned kWRegSizeLog2 = kWRegSizeInBitsLog2 - 3;
47 const unsigned kXRegSizeInBits = 64;
48 const unsigned kXRegSizeInBitsLog2 = 6;
49 const unsigned kXRegSize = kXRegSizeInBits >> 3;
50 const unsigned kXRegSizeLog2 = kXRegSizeInBitsLog2 - 3;
51 const unsigned kSRegSizeInBits = 32;
52 const unsigned kSRegSizeInBitsLog2 = 5;
53 const unsigned kSRegSize = kSRegSizeInBits >> 3;
54 const unsigned kSRegSizeLog2 = kSRegSizeInBitsLog2 - 3;
55 const unsigned kDRegSizeInBits = 64;
56 const unsigned kDRegSizeInBitsLog2 = 6;
57 const unsigned kDRegSize = kDRegSizeInBits >> 3;
58 const unsigned kDRegSizeLog2 = kDRegSizeInBitsLog2 - 3;
59 const int64_t kWRegMask = 0x00000000ffffffffL;
60 const int64_t kXRegMask = 0xffffffffffffffffL;
61 const int64_t kSRegMask = 0x00000000ffffffffL;
62 const int64_t kDRegMask = 0xffffffffffffffffL;
63 // TODO(all) check if the expression below works on all compilers or if it
64 // triggers an overflow error.
65 const int64_t kDSignBit = 63;
66 const int64_t kDSignMask = 0x1L << kDSignBit;
67 const int64_t kSSignBit = 31;
68 const int64_t kSSignMask = 0x1L << kSSignBit;
69 const int64_t kXSignBit = 63;
70 const int64_t kXSignMask = 0x1L << kXSignBit;
71 const int64_t kWSignBit = 31;
72 const int64_t kWSignMask = 0x1L << kWSignBit;
73 const int64_t kDQuietNanBit = 51;
74 const int64_t kDQuietNanMask = 0x1L << kDQuietNanBit;
75 const int64_t kSQuietNanBit = 22;
76 const int64_t kSQuietNanMask = 0x1L << kSQuietNanBit;
77 const int64_t kByteMask = 0xffL;
78 const int64_t kHalfWordMask = 0xffffL;
79 const int64_t kWordMask = 0xffffffffL;
80 const uint64_t kXMaxUInt = 0xffffffffffffffffUL;
81 const uint64_t kWMaxUInt = 0xffffffffUL;
82 const int64_t kXMaxInt = 0x7fffffffffffffffL;
83 const int64_t kXMinInt = 0x8000000000000000L;
84 const int32_t kWMaxInt = 0x7fffffff;
85 const int32_t kWMinInt = 0x80000000;
86 const unsigned kFramePointerRegCode = 29;
87 const unsigned kLinkRegCode = 30;
88 const unsigned kZeroRegCode = 31;
89 const unsigned kJSSPCode = 28;
90 const unsigned kSPRegInternalCode = 63;
91 const unsigned kRegCodeMask = 0x1f;
92 // Standard machine types defined by AAPCS64.
93 const unsigned kByteSize = 8;
94 const unsigned kByteSizeInBytes = kByteSize >> 3;
95 const unsigned kHalfWordSize = 16;
96 const unsigned kHalfWordSizeLog2 = 4;
97 const unsigned kHalfWordSizeInBytes = kHalfWordSize >> 3;
98 const unsigned kHalfWordSizeInBytesLog2 = kHalfWordSizeLog2 - 3;
99 const unsigned kWordSize = 32;
100 const unsigned kWordSizeLog2 = 5;
101 const unsigned kWordSizeInBytes = kWordSize >> 3;
102 const unsigned kWordSizeInBytesLog2 = kWordSizeLog2 - 3;
103 const unsigned kDoubleWordSize = 64;
104 const unsigned kDoubleWordSizeInBytes = kDoubleWordSize >> 3;
105 const unsigned kQuadWordSize = 128;
106 const unsigned kQuadWordSizeInBytes = kQuadWordSize >> 3;
107 // AArch64 floating-point specifics. These match IEEE-754.
108 const unsigned kDoubleMantissaBits = 52;
109 const unsigned kDoubleExponentBits = 11;
110 const unsigned kDoubleExponentBias = 1023;
111 const unsigned kFloatMantissaBits = 23;
112 const unsigned kFloatExponentBits = 8;
114 #define REGISTER_CODE_LIST(R) \
115 R(0) R(1) R(2) R(3) R(4) R(5) R(6) R(7) \
116 R(8) R(9) R(10) R(11) R(12) R(13) R(14) R(15) \
117 R(16) R(17) R(18) R(19) R(20) R(21) R(22) R(23) \
118 R(24) R(25) R(26) R(27) R(28) R(29) R(30) R(31)
120 #define INSTRUCTION_FIELDS_LIST(V_) \
121 /* Register fields */ \
122 V_(Rd, 4, 0, Bits) /* Destination register. */ \
123 V_(Rn, 9, 5, Bits) /* First source register. */ \
124 V_(Rm, 20, 16, Bits) /* Second source register. */ \
125 V_(Ra, 14, 10, Bits) /* Third source register. */ \
126 V_(Rt, 4, 0, Bits) /* Load dest / store source. */ \
127 V_(Rt2, 14, 10, Bits) /* Load second dest / */ \
128 /* store second source. */ \
129 V_(PrefetchMode, 4, 0, Bits) \
132 V_(SixtyFourBits, 31, 31, Bits) \
133 V_(FlagsUpdate, 29, 29, Bits) \
135 /* PC relative addressing */ \
136 V_(ImmPCRelHi, 23, 5, SignedBits) \
137 V_(ImmPCRelLo, 30, 29, Bits) \
139 /* Add/subtract/logical shift register */ \
140 V_(ShiftDP, 23, 22, Bits) \
141 V_(ImmDPShift, 15, 10, Bits) \
143 /* Add/subtract immediate */ \
144 V_(ImmAddSub, 21, 10, Bits) \
145 V_(ShiftAddSub, 23, 22, Bits) \
147 /* Add/substract extend */ \
148 V_(ImmExtendShift, 12, 10, Bits) \
149 V_(ExtendMode, 15, 13, Bits) \
152 V_(ImmMoveWide, 20, 5, Bits) \
153 V_(ShiftMoveWide, 22, 21, Bits) \
155 /* Logical immediate, bitfield and extract */ \
156 V_(BitN, 22, 22, Bits) \
157 V_(ImmRotate, 21, 16, Bits) \
158 V_(ImmSetBits, 15, 10, Bits) \
159 V_(ImmR, 21, 16, Bits) \
160 V_(ImmS, 15, 10, Bits) \
162 /* Test and branch immediate */ \
163 V_(ImmTestBranch, 18, 5, SignedBits) \
164 V_(ImmTestBranchBit40, 23, 19, Bits) \
165 V_(ImmTestBranchBit5, 31, 31, Bits) \
168 V_(Condition, 15, 12, Bits) \
169 V_(ConditionBranch, 3, 0, Bits) \
170 V_(Nzcv, 3, 0, Bits) \
171 V_(ImmCondCmp, 20, 16, Bits) \
172 V_(ImmCondBranch, 23, 5, SignedBits) \
174 /* Floating point */ \
175 V_(FPType, 23, 22, Bits) \
176 V_(ImmFP, 20, 13, Bits) \
177 V_(FPScale, 15, 10, Bits) \
180 V_(ImmLS, 20, 12, SignedBits) \
181 V_(ImmLSUnsigned, 21, 10, Bits) \
182 V_(ImmLSPair, 21, 15, SignedBits) \
183 V_(SizeLS, 31, 30, Bits) \
184 V_(ImmShiftLS, 12, 12, Bits) \
186 /* Other immediates */ \
187 V_(ImmUncondBranch, 25, 0, SignedBits) \
188 V_(ImmCmpBranch, 23, 5, SignedBits) \
189 V_(ImmLLiteral, 23, 5, SignedBits) \
190 V_(ImmException, 20, 5, Bits) \
191 V_(ImmHint, 11, 5, Bits) \
192 V_(ImmBarrierDomain, 11, 10, Bits) \
193 V_(ImmBarrierType, 9, 8, Bits) \
195 /* System (MRS, MSR) */ \
196 V_(ImmSystemRegister, 19, 5, Bits) \
197 V_(SysO0, 19, 19, Bits) \
198 V_(SysOp1, 18, 16, Bits) \
199 V_(SysOp2, 7, 5, Bits) \
200 V_(CRn, 15, 12, Bits) \
201 V_(CRm, 11, 8, Bits) \
204 #define SYSTEM_REGISTER_FIELDS_LIST(V_, M_) \
206 V_(Flags, 31, 28, Bits, uint32_t) \
207 V_(N, 31, 31, Bits, bool) \
208 V_(Z, 30, 30, Bits, bool) \
209 V_(C, 29, 29, Bits, bool) \
210 V_(V, 28, 28, Bits, uint32_t) \
211 M_(NZCV, Flags_mask) \
214 V_(AHP, 26, 26, Bits, bool) \
215 V_(DN, 25, 25, Bits, bool) \
216 V_(FZ, 24, 24, Bits, bool) \
217 V_(RMode, 23, 22, Bits, FPRounding) \
218 M_(FPCR, AHP_mask | DN_mask | FZ_mask | RMode_mask)
222 #define DECLARE_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1, unused_2) \
223 const int Name##_offset = LowBit; \
224 const int Name##_width = HighBit - LowBit + 1; \
225 const uint32_t Name##_mask = ((1 << Name##_width) - 1) << LowBit;
226 #define DECLARE_INSTRUCTION_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1) \
227 DECLARE_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1, unused_2)
228 #define NOTHING(A, B)
229 INSTRUCTION_FIELDS_LIST(DECLARE_INSTRUCTION_FIELDS_OFFSETS)
230 SYSTEM_REGISTER_FIELDS_LIST(DECLARE_FIELDS_OFFSETS, NOTHING)
232 #undef DECLARE_FIELDS_OFFSETS
233 #undef DECLARE_INSTRUCTION_FIELDS_OFFSETS
235 // ImmPCRel is a compound field (not present in INSTRUCTION_FIELDS_LIST), formed
236 // from ImmPCRelLo and ImmPCRelHi.
237 const int ImmPCRel_mask = ImmPCRelLo_mask | ImmPCRelHi_mask;
256 nv = 15 // Behaves as always/al.
259 inline Condition InvertCondition(Condition cond) {
260 // Conditions al and nv behave identically, as "always true". They can't be
261 // inverted, because there is no never condition.
262 ASSERT((cond != al) && (cond != nv));
263 return static_cast<Condition>(cond ^ 1);
266 // Corresponds to transposing the operands of a comparison.
267 inline Condition ReverseConditionForCmp(Condition cond) {
288 // In practice this function is only used with a condition coming from
289 // TokenToCondition in lithium-codegen-arm64.cc. Any other condition is
290 // invalid as it doesn't necessary make sense to reverse it (consider
291 // 'mi' for instance).
305 // Derive the flag combinations from the system register bit descriptions.
310 NZFlag = NFlag | ZFlag,
311 NCFlag = NFlag | CFlag,
312 NVFlag = NFlag | VFlag,
313 ZCFlag = ZFlag | CFlag,
314 ZVFlag = ZFlag | VFlag,
315 CVFlag = CFlag | VFlag,
316 NZCFlag = NFlag | ZFlag | CFlag,
317 NZVFlag = NFlag | ZFlag | VFlag,
318 NCVFlag = NFlag | CFlag | VFlag,
319 ZCVFlag = ZFlag | CFlag | VFlag,
320 NZCVFlag = NFlag | ZFlag | CFlag | VFlag,
322 // Floating-point comparison results.
323 FPEqualFlag = ZCFlag,
324 FPLessThanFlag = NFlag,
325 FPGreaterThanFlag = CFlag,
326 FPUnorderedFlag = CVFlag
372 // System/special register names.
373 // This information is not encoded as one field but as the concatenation of
374 // multiple fields (Op0<0>, Op1, Crn, Crm, Op2).
375 enum SystemRegister {
376 NZCV = ((0x1 << SysO0_offset) |
377 (0x3 << SysOp1_offset) |
378 (0x4 << CRn_offset) |
379 (0x2 << CRm_offset) |
380 (0x0 << SysOp2_offset)) >> ImmSystemRegister_offset,
381 FPCR = ((0x1 << SysO0_offset) |
382 (0x3 << SysOp1_offset) |
383 (0x4 << CRn_offset) |
384 (0x4 << CRm_offset) |
385 (0x0 << SysOp2_offset)) >> ImmSystemRegister_offset
388 // Instruction enumerations.
390 // These are the masks that define a class of instructions, and the list of
391 // instructions within each class. Each enumeration has a Fixed, FMask and
394 // Fixed: The fixed bits in this instruction class.
395 // FMask: The mask used to extract the fixed bits in the class.
396 // Mask: The mask used to identify the instructions within a class.
398 // The enumerations can be used like this:
400 // ASSERT(instr->Mask(PCRelAddressingFMask) == PCRelAddressingFixed);
401 // switch(instr->Mask(PCRelAddressingMask)) {
402 // case ADR: Format("adr 'Xd, 'AddrPCRelByte"); break;
403 // case ADRP: Format("adrp 'Xd, 'AddrPCRelPage"); break;
404 // default: printf("Unknown instruction\n");
409 enum GenericInstrField {
410 SixtyFourBits = 0x80000000,
411 ThirtyTwoBits = 0x00000000,
416 // PC relative addressing.
417 enum PCRelAddressingOp {
418 PCRelAddressingFixed = 0x10000000,
419 PCRelAddressingFMask = 0x1F000000,
420 PCRelAddressingMask = 0x9F000000,
421 ADR = PCRelAddressingFixed | 0x00000000,
422 ADRP = PCRelAddressingFixed | 0x80000000
425 // Add/sub (immediate, shifted and extended.)
426 const int kSFOffset = 31;
428 AddSubOpMask = 0x60000000,
429 AddSubSetFlagsBit = 0x20000000,
431 ADDS = ADD | AddSubSetFlagsBit,
433 SUBS = SUB | AddSubSetFlagsBit
436 #define ADD_SUB_OP_LIST(V) \
442 enum AddSubImmediateOp {
443 AddSubImmediateFixed = 0x11000000,
444 AddSubImmediateFMask = 0x1F000000,
445 AddSubImmediateMask = 0xFF000000,
446 #define ADD_SUB_IMMEDIATE(A) \
447 A##_w_imm = AddSubImmediateFixed | A, \
448 A##_x_imm = AddSubImmediateFixed | A | SixtyFourBits
449 ADD_SUB_OP_LIST(ADD_SUB_IMMEDIATE)
450 #undef ADD_SUB_IMMEDIATE
453 enum AddSubShiftedOp {
454 AddSubShiftedFixed = 0x0B000000,
455 AddSubShiftedFMask = 0x1F200000,
456 AddSubShiftedMask = 0xFF200000,
457 #define ADD_SUB_SHIFTED(A) \
458 A##_w_shift = AddSubShiftedFixed | A, \
459 A##_x_shift = AddSubShiftedFixed | A | SixtyFourBits
460 ADD_SUB_OP_LIST(ADD_SUB_SHIFTED)
461 #undef ADD_SUB_SHIFTED
464 enum AddSubExtendedOp {
465 AddSubExtendedFixed = 0x0B200000,
466 AddSubExtendedFMask = 0x1F200000,
467 AddSubExtendedMask = 0xFFE00000,
468 #define ADD_SUB_EXTENDED(A) \
469 A##_w_ext = AddSubExtendedFixed | A, \
470 A##_x_ext = AddSubExtendedFixed | A | SixtyFourBits
471 ADD_SUB_OP_LIST(ADD_SUB_EXTENDED)
472 #undef ADD_SUB_EXTENDED
475 // Add/sub with carry.
476 enum AddSubWithCarryOp {
477 AddSubWithCarryFixed = 0x1A000000,
478 AddSubWithCarryFMask = 0x1FE00000,
479 AddSubWithCarryMask = 0xFFE0FC00,
480 ADC_w = AddSubWithCarryFixed | ADD,
481 ADC_x = AddSubWithCarryFixed | ADD | SixtyFourBits,
483 ADCS_w = AddSubWithCarryFixed | ADDS,
484 ADCS_x = AddSubWithCarryFixed | ADDS | SixtyFourBits,
485 SBC_w = AddSubWithCarryFixed | SUB,
486 SBC_x = AddSubWithCarryFixed | SUB | SixtyFourBits,
488 SBCS_w = AddSubWithCarryFixed | SUBS,
489 SBCS_x = AddSubWithCarryFixed | SUBS | SixtyFourBits
493 // Logical (immediate and shifted register).
495 LogicalOpMask = 0x60200000,
507 // Logical immediate.
508 enum LogicalImmediateOp {
509 LogicalImmediateFixed = 0x12000000,
510 LogicalImmediateFMask = 0x1F800000,
511 LogicalImmediateMask = 0xFF800000,
512 AND_w_imm = LogicalImmediateFixed | AND,
513 AND_x_imm = LogicalImmediateFixed | AND | SixtyFourBits,
514 ORR_w_imm = LogicalImmediateFixed | ORR,
515 ORR_x_imm = LogicalImmediateFixed | ORR | SixtyFourBits,
516 EOR_w_imm = LogicalImmediateFixed | EOR,
517 EOR_x_imm = LogicalImmediateFixed | EOR | SixtyFourBits,
518 ANDS_w_imm = LogicalImmediateFixed | ANDS,
519 ANDS_x_imm = LogicalImmediateFixed | ANDS | SixtyFourBits
522 // Logical shifted register.
523 enum LogicalShiftedOp {
524 LogicalShiftedFixed = 0x0A000000,
525 LogicalShiftedFMask = 0x1F000000,
526 LogicalShiftedMask = 0xFF200000,
527 AND_w = LogicalShiftedFixed | AND,
528 AND_x = LogicalShiftedFixed | AND | SixtyFourBits,
530 BIC_w = LogicalShiftedFixed | BIC,
531 BIC_x = LogicalShiftedFixed | BIC | SixtyFourBits,
533 ORR_w = LogicalShiftedFixed | ORR,
534 ORR_x = LogicalShiftedFixed | ORR | SixtyFourBits,
536 ORN_w = LogicalShiftedFixed | ORN,
537 ORN_x = LogicalShiftedFixed | ORN | SixtyFourBits,
539 EOR_w = LogicalShiftedFixed | EOR,
540 EOR_x = LogicalShiftedFixed | EOR | SixtyFourBits,
542 EON_w = LogicalShiftedFixed | EON,
543 EON_x = LogicalShiftedFixed | EON | SixtyFourBits,
545 ANDS_w = LogicalShiftedFixed | ANDS,
546 ANDS_x = LogicalShiftedFixed | ANDS | SixtyFourBits,
548 BICS_w = LogicalShiftedFixed | BICS,
549 BICS_x = LogicalShiftedFixed | BICS | SixtyFourBits,
553 // Move wide immediate.
554 enum MoveWideImmediateOp {
555 MoveWideImmediateFixed = 0x12800000,
556 MoveWideImmediateFMask = 0x1F800000,
557 MoveWideImmediateMask = 0xFF800000,
561 MOVN_w = MoveWideImmediateFixed | MOVN,
562 MOVN_x = MoveWideImmediateFixed | MOVN | SixtyFourBits,
563 MOVZ_w = MoveWideImmediateFixed | MOVZ,
564 MOVZ_x = MoveWideImmediateFixed | MOVZ | SixtyFourBits,
565 MOVK_w = MoveWideImmediateFixed | MOVK,
566 MOVK_x = MoveWideImmediateFixed | MOVK | SixtyFourBits
570 const int kBitfieldNOffset = 22;
572 BitfieldFixed = 0x13000000,
573 BitfieldFMask = 0x1F800000,
574 BitfieldMask = 0xFF800000,
575 SBFM_w = BitfieldFixed | 0x00000000,
576 SBFM_x = BitfieldFixed | 0x80000000,
578 BFM_w = BitfieldFixed | 0x20000000,
579 BFM_x = BitfieldFixed | 0xA0000000,
581 UBFM_w = BitfieldFixed | 0x40000000,
582 UBFM_x = BitfieldFixed | 0xC0000000,
589 ExtractFixed = 0x13800000,
590 ExtractFMask = 0x1F800000,
591 ExtractMask = 0xFFA00000,
592 EXTR_w = ExtractFixed | 0x00000000,
593 EXTR_x = ExtractFixed | 0x80000000,
597 // Unconditional branch.
598 enum UnconditionalBranchOp {
599 UnconditionalBranchFixed = 0x14000000,
600 UnconditionalBranchFMask = 0x7C000000,
601 UnconditionalBranchMask = 0xFC000000,
602 B = UnconditionalBranchFixed | 0x00000000,
603 BL = UnconditionalBranchFixed | 0x80000000
606 // Unconditional branch to register.
607 enum UnconditionalBranchToRegisterOp {
608 UnconditionalBranchToRegisterFixed = 0xD6000000,
609 UnconditionalBranchToRegisterFMask = 0xFE000000,
610 UnconditionalBranchToRegisterMask = 0xFFFFFC1F,
611 BR = UnconditionalBranchToRegisterFixed | 0x001F0000,
612 BLR = UnconditionalBranchToRegisterFixed | 0x003F0000,
613 RET = UnconditionalBranchToRegisterFixed | 0x005F0000
616 // Compare and branch.
617 enum CompareBranchOp {
618 CompareBranchFixed = 0x34000000,
619 CompareBranchFMask = 0x7E000000,
620 CompareBranchMask = 0xFF000000,
621 CBZ_w = CompareBranchFixed | 0x00000000,
622 CBZ_x = CompareBranchFixed | 0x80000000,
624 CBNZ_w = CompareBranchFixed | 0x01000000,
625 CBNZ_x = CompareBranchFixed | 0x81000000,
631 TestBranchFixed = 0x36000000,
632 TestBranchFMask = 0x7E000000,
633 TestBranchMask = 0x7F000000,
634 TBZ = TestBranchFixed | 0x00000000,
635 TBNZ = TestBranchFixed | 0x01000000
638 // Conditional branch.
639 enum ConditionalBranchOp {
640 ConditionalBranchFixed = 0x54000000,
641 ConditionalBranchFMask = 0xFE000000,
642 ConditionalBranchMask = 0xFF000010,
643 B_cond = ConditionalBranchFixed | 0x00000000
647 // System instruction encoding is complicated because some instructions use op
648 // and CR fields to encode parameters. To handle this cleanly, the system
649 // instructions are split into more than one enum.
652 SystemFixed = 0xD5000000,
653 SystemFMask = 0xFFC00000
656 enum SystemSysRegOp {
657 SystemSysRegFixed = 0xD5100000,
658 SystemSysRegFMask = 0xFFD00000,
659 SystemSysRegMask = 0xFFF00000,
660 MRS = SystemSysRegFixed | 0x00200000,
661 MSR = SystemSysRegFixed | 0x00000000
665 SystemHintFixed = 0xD503201F,
666 SystemHintFMask = 0xFFFFF01F,
667 SystemHintMask = 0xFFFFF01F,
668 HINT = SystemHintFixed | 0x00000000
673 ExceptionFixed = 0xD4000000,
674 ExceptionFMask = 0xFF000000,
675 ExceptionMask = 0xFFE0001F,
676 HLT = ExceptionFixed | 0x00400000,
677 BRK = ExceptionFixed | 0x00200000,
678 SVC = ExceptionFixed | 0x00000001,
679 HVC = ExceptionFixed | 0x00000002,
680 SMC = ExceptionFixed | 0x00000003,
681 DCPS1 = ExceptionFixed | 0x00A00001,
682 DCPS2 = ExceptionFixed | 0x00A00002,
683 DCPS3 = ExceptionFixed | 0x00A00003
685 // Code used to spot hlt instructions that should not be hit.
686 const int kHltBadCode = 0xbad;
689 MemBarrierFixed = 0xD503309F,
690 MemBarrierFMask = 0xFFFFF09F,
691 MemBarrierMask = 0xFFFFF0FF,
692 DSB = MemBarrierFixed | 0x00000000,
693 DMB = MemBarrierFixed | 0x00000020,
694 ISB = MemBarrierFixed | 0x00000040
697 // Any load or store (including pair).
698 enum LoadStoreAnyOp {
699 LoadStoreAnyFMask = 0x0a000000,
700 LoadStoreAnyFixed = 0x08000000
703 // Any load pair or store pair.
704 enum LoadStorePairAnyOp {
705 LoadStorePairAnyFMask = 0x3a000000,
706 LoadStorePairAnyFixed = 0x28000000
709 #define LOAD_STORE_PAIR_OP_LIST(V) \
710 V(STP, w, 0x00000000), \
711 V(LDP, w, 0x00400000), \
712 V(LDPSW, x, 0x40400000), \
713 V(STP, x, 0x80000000), \
714 V(LDP, x, 0x80400000), \
715 V(STP, s, 0x04000000), \
716 V(LDP, s, 0x04400000), \
717 V(STP, d, 0x44000000), \
718 V(LDP, d, 0x44400000)
720 // Load/store pair (post, pre and offset.)
721 enum LoadStorePairOp {
722 LoadStorePairMask = 0xC4400000,
723 LoadStorePairLBit = 1 << 22,
724 #define LOAD_STORE_PAIR(A, B, C) \
726 LOAD_STORE_PAIR_OP_LIST(LOAD_STORE_PAIR)
727 #undef LOAD_STORE_PAIR
730 enum LoadStorePairPostIndexOp {
731 LoadStorePairPostIndexFixed = 0x28800000,
732 LoadStorePairPostIndexFMask = 0x3B800000,
733 LoadStorePairPostIndexMask = 0xFFC00000,
734 #define LOAD_STORE_PAIR_POST_INDEX(A, B, C) \
735 A##_##B##_post = LoadStorePairPostIndexFixed | A##_##B
736 LOAD_STORE_PAIR_OP_LIST(LOAD_STORE_PAIR_POST_INDEX)
737 #undef LOAD_STORE_PAIR_POST_INDEX
740 enum LoadStorePairPreIndexOp {
741 LoadStorePairPreIndexFixed = 0x29800000,
742 LoadStorePairPreIndexFMask = 0x3B800000,
743 LoadStorePairPreIndexMask = 0xFFC00000,
744 #define LOAD_STORE_PAIR_PRE_INDEX(A, B, C) \
745 A##_##B##_pre = LoadStorePairPreIndexFixed | A##_##B
746 LOAD_STORE_PAIR_OP_LIST(LOAD_STORE_PAIR_PRE_INDEX)
747 #undef LOAD_STORE_PAIR_PRE_INDEX
750 enum LoadStorePairOffsetOp {
751 LoadStorePairOffsetFixed = 0x29000000,
752 LoadStorePairOffsetFMask = 0x3B800000,
753 LoadStorePairOffsetMask = 0xFFC00000,
754 #define LOAD_STORE_PAIR_OFFSET(A, B, C) \
755 A##_##B##_off = LoadStorePairOffsetFixed | A##_##B
756 LOAD_STORE_PAIR_OP_LIST(LOAD_STORE_PAIR_OFFSET)
757 #undef LOAD_STORE_PAIR_OFFSET
760 enum LoadStorePairNonTemporalOp {
761 LoadStorePairNonTemporalFixed = 0x28000000,
762 LoadStorePairNonTemporalFMask = 0x3B800000,
763 LoadStorePairNonTemporalMask = 0xFFC00000,
764 STNP_w = LoadStorePairNonTemporalFixed | STP_w,
765 LDNP_w = LoadStorePairNonTemporalFixed | LDP_w,
766 STNP_x = LoadStorePairNonTemporalFixed | STP_x,
767 LDNP_x = LoadStorePairNonTemporalFixed | LDP_x,
768 STNP_s = LoadStorePairNonTemporalFixed | STP_s,
769 LDNP_s = LoadStorePairNonTemporalFixed | LDP_s,
770 STNP_d = LoadStorePairNonTemporalFixed | STP_d,
771 LDNP_d = LoadStorePairNonTemporalFixed | LDP_d
776 LoadLiteralFixed = 0x18000000,
777 LoadLiteralFMask = 0x3B000000,
778 LoadLiteralMask = 0xFF000000,
779 LDR_w_lit = LoadLiteralFixed | 0x00000000,
780 LDR_x_lit = LoadLiteralFixed | 0x40000000,
781 LDRSW_x_lit = LoadLiteralFixed | 0x80000000,
782 PRFM_lit = LoadLiteralFixed | 0xC0000000,
783 LDR_s_lit = LoadLiteralFixed | 0x04000000,
784 LDR_d_lit = LoadLiteralFixed | 0x44000000
787 #define LOAD_STORE_OP_LIST(V) \
788 V(ST, RB, w, 0x00000000), \
789 V(ST, RH, w, 0x40000000), \
790 V(ST, R, w, 0x80000000), \
791 V(ST, R, x, 0xC0000000), \
792 V(LD, RB, w, 0x00400000), \
793 V(LD, RH, w, 0x40400000), \
794 V(LD, R, w, 0x80400000), \
795 V(LD, R, x, 0xC0400000), \
796 V(LD, RSB, x, 0x00800000), \
797 V(LD, RSH, x, 0x40800000), \
798 V(LD, RSW, x, 0x80800000), \
799 V(LD, RSB, w, 0x00C00000), \
800 V(LD, RSH, w, 0x40C00000), \
801 V(ST, R, s, 0x84000000), \
802 V(ST, R, d, 0xC4000000), \
803 V(LD, R, s, 0x84400000), \
804 V(LD, R, d, 0xC4400000)
807 // Load/store unscaled offset.
808 enum LoadStoreUnscaledOffsetOp {
809 LoadStoreUnscaledOffsetFixed = 0x38000000,
810 LoadStoreUnscaledOffsetFMask = 0x3B200C00,
811 LoadStoreUnscaledOffsetMask = 0xFFE00C00,
812 #define LOAD_STORE_UNSCALED(A, B, C, D) \
813 A##U##B##_##C = LoadStoreUnscaledOffsetFixed | D
814 LOAD_STORE_OP_LIST(LOAD_STORE_UNSCALED)
815 #undef LOAD_STORE_UNSCALED
818 // Load/store (post, pre, offset and unsigned.)
820 LoadStoreOpMask = 0xC4C00000,
821 #define LOAD_STORE(A, B, C, D) \
823 LOAD_STORE_OP_LIST(LOAD_STORE),
828 // Load/store post index.
829 enum LoadStorePostIndex {
830 LoadStorePostIndexFixed = 0x38000400,
831 LoadStorePostIndexFMask = 0x3B200C00,
832 LoadStorePostIndexMask = 0xFFE00C00,
833 #define LOAD_STORE_POST_INDEX(A, B, C, D) \
834 A##B##_##C##_post = LoadStorePostIndexFixed | D
835 LOAD_STORE_OP_LIST(LOAD_STORE_POST_INDEX)
836 #undef LOAD_STORE_POST_INDEX
839 // Load/store pre index.
840 enum LoadStorePreIndex {
841 LoadStorePreIndexFixed = 0x38000C00,
842 LoadStorePreIndexFMask = 0x3B200C00,
843 LoadStorePreIndexMask = 0xFFE00C00,
844 #define LOAD_STORE_PRE_INDEX(A, B, C, D) \
845 A##B##_##C##_pre = LoadStorePreIndexFixed | D
846 LOAD_STORE_OP_LIST(LOAD_STORE_PRE_INDEX)
847 #undef LOAD_STORE_PRE_INDEX
850 // Load/store unsigned offset.
851 enum LoadStoreUnsignedOffset {
852 LoadStoreUnsignedOffsetFixed = 0x39000000,
853 LoadStoreUnsignedOffsetFMask = 0x3B000000,
854 LoadStoreUnsignedOffsetMask = 0xFFC00000,
855 PRFM_unsigned = LoadStoreUnsignedOffsetFixed | PRFM,
856 #define LOAD_STORE_UNSIGNED_OFFSET(A, B, C, D) \
857 A##B##_##C##_unsigned = LoadStoreUnsignedOffsetFixed | D
858 LOAD_STORE_OP_LIST(LOAD_STORE_UNSIGNED_OFFSET)
859 #undef LOAD_STORE_UNSIGNED_OFFSET
862 // Load/store register offset.
863 enum LoadStoreRegisterOffset {
864 LoadStoreRegisterOffsetFixed = 0x38200800,
865 LoadStoreRegisterOffsetFMask = 0x3B200C00,
866 LoadStoreRegisterOffsetMask = 0xFFE00C00,
867 PRFM_reg = LoadStoreRegisterOffsetFixed | PRFM,
868 #define LOAD_STORE_REGISTER_OFFSET(A, B, C, D) \
869 A##B##_##C##_reg = LoadStoreRegisterOffsetFixed | D
870 LOAD_STORE_OP_LIST(LOAD_STORE_REGISTER_OFFSET)
871 #undef LOAD_STORE_REGISTER_OFFSET
874 // Conditional compare.
875 enum ConditionalCompareOp {
876 ConditionalCompareMask = 0x60000000,
881 // Conditional compare register.
882 enum ConditionalCompareRegisterOp {
883 ConditionalCompareRegisterFixed = 0x1A400000,
884 ConditionalCompareRegisterFMask = 0x1FE00800,
885 ConditionalCompareRegisterMask = 0xFFE00C10,
886 CCMN_w = ConditionalCompareRegisterFixed | CCMN,
887 CCMN_x = ConditionalCompareRegisterFixed | SixtyFourBits | CCMN,
888 CCMP_w = ConditionalCompareRegisterFixed | CCMP,
889 CCMP_x = ConditionalCompareRegisterFixed | SixtyFourBits | CCMP
892 // Conditional compare immediate.
893 enum ConditionalCompareImmediateOp {
894 ConditionalCompareImmediateFixed = 0x1A400800,
895 ConditionalCompareImmediateFMask = 0x1FE00800,
896 ConditionalCompareImmediateMask = 0xFFE00C10,
897 CCMN_w_imm = ConditionalCompareImmediateFixed | CCMN,
898 CCMN_x_imm = ConditionalCompareImmediateFixed | SixtyFourBits | CCMN,
899 CCMP_w_imm = ConditionalCompareImmediateFixed | CCMP,
900 CCMP_x_imm = ConditionalCompareImmediateFixed | SixtyFourBits | CCMP
903 // Conditional select.
904 enum ConditionalSelectOp {
905 ConditionalSelectFixed = 0x1A800000,
906 ConditionalSelectFMask = 0x1FE00000,
907 ConditionalSelectMask = 0xFFE00C00,
908 CSEL_w = ConditionalSelectFixed | 0x00000000,
909 CSEL_x = ConditionalSelectFixed | 0x80000000,
911 CSINC_w = ConditionalSelectFixed | 0x00000400,
912 CSINC_x = ConditionalSelectFixed | 0x80000400,
914 CSINV_w = ConditionalSelectFixed | 0x40000000,
915 CSINV_x = ConditionalSelectFixed | 0xC0000000,
917 CSNEG_w = ConditionalSelectFixed | 0x40000400,
918 CSNEG_x = ConditionalSelectFixed | 0xC0000400,
922 // Data processing 1 source.
923 enum DataProcessing1SourceOp {
924 DataProcessing1SourceFixed = 0x5AC00000,
925 DataProcessing1SourceFMask = 0x5FE00000,
926 DataProcessing1SourceMask = 0xFFFFFC00,
927 RBIT = DataProcessing1SourceFixed | 0x00000000,
929 RBIT_x = RBIT | SixtyFourBits,
930 REV16 = DataProcessing1SourceFixed | 0x00000400,
932 REV16_x = REV16 | SixtyFourBits,
933 REV = DataProcessing1SourceFixed | 0x00000800,
935 REV32_x = REV | SixtyFourBits,
936 REV_x = DataProcessing1SourceFixed | SixtyFourBits | 0x00000C00,
937 CLZ = DataProcessing1SourceFixed | 0x00001000,
939 CLZ_x = CLZ | SixtyFourBits,
940 CLS = DataProcessing1SourceFixed | 0x00001400,
942 CLS_x = CLS | SixtyFourBits
945 // Data processing 2 source.
946 enum DataProcessing2SourceOp {
947 DataProcessing2SourceFixed = 0x1AC00000,
948 DataProcessing2SourceFMask = 0x5FE00000,
949 DataProcessing2SourceMask = 0xFFE0FC00,
950 UDIV_w = DataProcessing2SourceFixed | 0x00000800,
951 UDIV_x = DataProcessing2SourceFixed | 0x80000800,
953 SDIV_w = DataProcessing2SourceFixed | 0x00000C00,
954 SDIV_x = DataProcessing2SourceFixed | 0x80000C00,
956 LSLV_w = DataProcessing2SourceFixed | 0x00002000,
957 LSLV_x = DataProcessing2SourceFixed | 0x80002000,
959 LSRV_w = DataProcessing2SourceFixed | 0x00002400,
960 LSRV_x = DataProcessing2SourceFixed | 0x80002400,
962 ASRV_w = DataProcessing2SourceFixed | 0x00002800,
963 ASRV_x = DataProcessing2SourceFixed | 0x80002800,
965 RORV_w = DataProcessing2SourceFixed | 0x00002C00,
966 RORV_x = DataProcessing2SourceFixed | 0x80002C00,
968 CRC32B = DataProcessing2SourceFixed | 0x00004000,
969 CRC32H = DataProcessing2SourceFixed | 0x00004400,
970 CRC32W = DataProcessing2SourceFixed | 0x00004800,
971 CRC32X = DataProcessing2SourceFixed | SixtyFourBits | 0x00004C00,
972 CRC32CB = DataProcessing2SourceFixed | 0x00005000,
973 CRC32CH = DataProcessing2SourceFixed | 0x00005400,
974 CRC32CW = DataProcessing2SourceFixed | 0x00005800,
975 CRC32CX = DataProcessing2SourceFixed | SixtyFourBits | 0x00005C00
978 // Data processing 3 source.
979 enum DataProcessing3SourceOp {
980 DataProcessing3SourceFixed = 0x1B000000,
981 DataProcessing3SourceFMask = 0x1F000000,
982 DataProcessing3SourceMask = 0xFFE08000,
983 MADD_w = DataProcessing3SourceFixed | 0x00000000,
984 MADD_x = DataProcessing3SourceFixed | 0x80000000,
986 MSUB_w = DataProcessing3SourceFixed | 0x00008000,
987 MSUB_x = DataProcessing3SourceFixed | 0x80008000,
989 SMADDL_x = DataProcessing3SourceFixed | 0x80200000,
990 SMSUBL_x = DataProcessing3SourceFixed | 0x80208000,
991 SMULH_x = DataProcessing3SourceFixed | 0x80400000,
992 UMADDL_x = DataProcessing3SourceFixed | 0x80A00000,
993 UMSUBL_x = DataProcessing3SourceFixed | 0x80A08000,
994 UMULH_x = DataProcessing3SourceFixed | 0x80C00000
997 // Floating point compare.
999 FPCompareFixed = 0x1E202000,
1000 FPCompareFMask = 0x5F203C00,
1001 FPCompareMask = 0xFFE0FC1F,
1002 FCMP_s = FPCompareFixed | 0x00000000,
1003 FCMP_d = FPCompareFixed | FP64 | 0x00000000,
1005 FCMP_s_zero = FPCompareFixed | 0x00000008,
1006 FCMP_d_zero = FPCompareFixed | FP64 | 0x00000008,
1007 FCMP_zero = FCMP_s_zero,
1008 FCMPE_s = FPCompareFixed | 0x00000010,
1009 FCMPE_d = FPCompareFixed | FP64 | 0x00000010,
1010 FCMPE_s_zero = FPCompareFixed | 0x00000018,
1011 FCMPE_d_zero = FPCompareFixed | FP64 | 0x00000018
1014 // Floating point conditional compare.
1015 enum FPConditionalCompareOp {
1016 FPConditionalCompareFixed = 0x1E200400,
1017 FPConditionalCompareFMask = 0x5F200C00,
1018 FPConditionalCompareMask = 0xFFE00C10,
1019 FCCMP_s = FPConditionalCompareFixed | 0x00000000,
1020 FCCMP_d = FPConditionalCompareFixed | FP64 | 0x00000000,
1022 FCCMPE_s = FPConditionalCompareFixed | 0x00000010,
1023 FCCMPE_d = FPConditionalCompareFixed | FP64 | 0x00000010,
1027 // Floating point conditional select.
1028 enum FPConditionalSelectOp {
1029 FPConditionalSelectFixed = 0x1E200C00,
1030 FPConditionalSelectFMask = 0x5F200C00,
1031 FPConditionalSelectMask = 0xFFE00C00,
1032 FCSEL_s = FPConditionalSelectFixed | 0x00000000,
1033 FCSEL_d = FPConditionalSelectFixed | FP64 | 0x00000000,
1037 // Floating point immediate.
1038 enum FPImmediateOp {
1039 FPImmediateFixed = 0x1E201000,
1040 FPImmediateFMask = 0x5F201C00,
1041 FPImmediateMask = 0xFFE01C00,
1042 FMOV_s_imm = FPImmediateFixed | 0x00000000,
1043 FMOV_d_imm = FPImmediateFixed | FP64 | 0x00000000
1046 // Floating point data processing 1 source.
1047 enum FPDataProcessing1SourceOp {
1048 FPDataProcessing1SourceFixed = 0x1E204000,
1049 FPDataProcessing1SourceFMask = 0x5F207C00,
1050 FPDataProcessing1SourceMask = 0xFFFFFC00,
1051 FMOV_s = FPDataProcessing1SourceFixed | 0x00000000,
1052 FMOV_d = FPDataProcessing1SourceFixed | FP64 | 0x00000000,
1054 FABS_s = FPDataProcessing1SourceFixed | 0x00008000,
1055 FABS_d = FPDataProcessing1SourceFixed | FP64 | 0x00008000,
1057 FNEG_s = FPDataProcessing1SourceFixed | 0x00010000,
1058 FNEG_d = FPDataProcessing1SourceFixed | FP64 | 0x00010000,
1060 FSQRT_s = FPDataProcessing1SourceFixed | 0x00018000,
1061 FSQRT_d = FPDataProcessing1SourceFixed | FP64 | 0x00018000,
1063 FCVT_ds = FPDataProcessing1SourceFixed | 0x00028000,
1064 FCVT_sd = FPDataProcessing1SourceFixed | FP64 | 0x00020000,
1065 FRINTN_s = FPDataProcessing1SourceFixed | 0x00040000,
1066 FRINTN_d = FPDataProcessing1SourceFixed | FP64 | 0x00040000,
1068 FRINTP_s = FPDataProcessing1SourceFixed | 0x00048000,
1069 FRINTP_d = FPDataProcessing1SourceFixed | FP64 | 0x00048000,
1071 FRINTM_s = FPDataProcessing1SourceFixed | 0x00050000,
1072 FRINTM_d = FPDataProcessing1SourceFixed | FP64 | 0x00050000,
1074 FRINTZ_s = FPDataProcessing1SourceFixed | 0x00058000,
1075 FRINTZ_d = FPDataProcessing1SourceFixed | FP64 | 0x00058000,
1077 FRINTA_s = FPDataProcessing1SourceFixed | 0x00060000,
1078 FRINTA_d = FPDataProcessing1SourceFixed | FP64 | 0x00060000,
1080 FRINTX_s = FPDataProcessing1SourceFixed | 0x00070000,
1081 FRINTX_d = FPDataProcessing1SourceFixed | FP64 | 0x00070000,
1083 FRINTI_s = FPDataProcessing1SourceFixed | 0x00078000,
1084 FRINTI_d = FPDataProcessing1SourceFixed | FP64 | 0x00078000,
1088 // Floating point data processing 2 source.
1089 enum FPDataProcessing2SourceOp {
1090 FPDataProcessing2SourceFixed = 0x1E200800,
1091 FPDataProcessing2SourceFMask = 0x5F200C00,
1092 FPDataProcessing2SourceMask = 0xFFE0FC00,
1093 FMUL = FPDataProcessing2SourceFixed | 0x00000000,
1095 FMUL_d = FMUL | FP64,
1096 FDIV = FPDataProcessing2SourceFixed | 0x00001000,
1098 FDIV_d = FDIV | FP64,
1099 FADD = FPDataProcessing2SourceFixed | 0x00002000,
1101 FADD_d = FADD | FP64,
1102 FSUB = FPDataProcessing2SourceFixed | 0x00003000,
1104 FSUB_d = FSUB | FP64,
1105 FMAX = FPDataProcessing2SourceFixed | 0x00004000,
1107 FMAX_d = FMAX | FP64,
1108 FMIN = FPDataProcessing2SourceFixed | 0x00005000,
1110 FMIN_d = FMIN | FP64,
1111 FMAXNM = FPDataProcessing2SourceFixed | 0x00006000,
1113 FMAXNM_d = FMAXNM | FP64,
1114 FMINNM = FPDataProcessing2SourceFixed | 0x00007000,
1116 FMINNM_d = FMINNM | FP64,
1117 FNMUL = FPDataProcessing2SourceFixed | 0x00008000,
1119 FNMUL_d = FNMUL | FP64
1122 // Floating point data processing 3 source.
1123 enum FPDataProcessing3SourceOp {
1124 FPDataProcessing3SourceFixed = 0x1F000000,
1125 FPDataProcessing3SourceFMask = 0x5F000000,
1126 FPDataProcessing3SourceMask = 0xFFE08000,
1127 FMADD_s = FPDataProcessing3SourceFixed | 0x00000000,
1128 FMSUB_s = FPDataProcessing3SourceFixed | 0x00008000,
1129 FNMADD_s = FPDataProcessing3SourceFixed | 0x00200000,
1130 FNMSUB_s = FPDataProcessing3SourceFixed | 0x00208000,
1131 FMADD_d = FPDataProcessing3SourceFixed | 0x00400000,
1132 FMSUB_d = FPDataProcessing3SourceFixed | 0x00408000,
1133 FNMADD_d = FPDataProcessing3SourceFixed | 0x00600000,
1134 FNMSUB_d = FPDataProcessing3SourceFixed | 0x00608000
1137 // Conversion between floating point and integer.
1138 enum FPIntegerConvertOp {
1139 FPIntegerConvertFixed = 0x1E200000,
1140 FPIntegerConvertFMask = 0x5F20FC00,
1141 FPIntegerConvertMask = 0xFFFFFC00,
1142 FCVTNS = FPIntegerConvertFixed | 0x00000000,
1144 FCVTNS_xs = FCVTNS | SixtyFourBits,
1145 FCVTNS_wd = FCVTNS | FP64,
1146 FCVTNS_xd = FCVTNS | SixtyFourBits | FP64,
1147 FCVTNU = FPIntegerConvertFixed | 0x00010000,
1149 FCVTNU_xs = FCVTNU | SixtyFourBits,
1150 FCVTNU_wd = FCVTNU | FP64,
1151 FCVTNU_xd = FCVTNU | SixtyFourBits | FP64,
1152 FCVTPS = FPIntegerConvertFixed | 0x00080000,
1154 FCVTPS_xs = FCVTPS | SixtyFourBits,
1155 FCVTPS_wd = FCVTPS | FP64,
1156 FCVTPS_xd = FCVTPS | SixtyFourBits | FP64,
1157 FCVTPU = FPIntegerConvertFixed | 0x00090000,
1159 FCVTPU_xs = FCVTPU | SixtyFourBits,
1160 FCVTPU_wd = FCVTPU | FP64,
1161 FCVTPU_xd = FCVTPU | SixtyFourBits | FP64,
1162 FCVTMS = FPIntegerConvertFixed | 0x00100000,
1164 FCVTMS_xs = FCVTMS | SixtyFourBits,
1165 FCVTMS_wd = FCVTMS | FP64,
1166 FCVTMS_xd = FCVTMS | SixtyFourBits | FP64,
1167 FCVTMU = FPIntegerConvertFixed | 0x00110000,
1169 FCVTMU_xs = FCVTMU | SixtyFourBits,
1170 FCVTMU_wd = FCVTMU | FP64,
1171 FCVTMU_xd = FCVTMU | SixtyFourBits | FP64,
1172 FCVTZS = FPIntegerConvertFixed | 0x00180000,
1174 FCVTZS_xs = FCVTZS | SixtyFourBits,
1175 FCVTZS_wd = FCVTZS | FP64,
1176 FCVTZS_xd = FCVTZS | SixtyFourBits | FP64,
1177 FCVTZU = FPIntegerConvertFixed | 0x00190000,
1179 FCVTZU_xs = FCVTZU | SixtyFourBits,
1180 FCVTZU_wd = FCVTZU | FP64,
1181 FCVTZU_xd = FCVTZU | SixtyFourBits | FP64,
1182 SCVTF = FPIntegerConvertFixed | 0x00020000,
1184 SCVTF_sx = SCVTF | SixtyFourBits,
1185 SCVTF_dw = SCVTF | FP64,
1186 SCVTF_dx = SCVTF | SixtyFourBits | FP64,
1187 UCVTF = FPIntegerConvertFixed | 0x00030000,
1189 UCVTF_sx = UCVTF | SixtyFourBits,
1190 UCVTF_dw = UCVTF | FP64,
1191 UCVTF_dx = UCVTF | SixtyFourBits | FP64,
1192 FCVTAS = FPIntegerConvertFixed | 0x00040000,
1194 FCVTAS_xs = FCVTAS | SixtyFourBits,
1195 FCVTAS_wd = FCVTAS | FP64,
1196 FCVTAS_xd = FCVTAS | SixtyFourBits | FP64,
1197 FCVTAU = FPIntegerConvertFixed | 0x00050000,
1199 FCVTAU_xs = FCVTAU | SixtyFourBits,
1200 FCVTAU_wd = FCVTAU | FP64,
1201 FCVTAU_xd = FCVTAU | SixtyFourBits | FP64,
1202 FMOV_ws = FPIntegerConvertFixed | 0x00060000,
1203 FMOV_sw = FPIntegerConvertFixed | 0x00070000,
1204 FMOV_xd = FMOV_ws | SixtyFourBits | FP64,
1205 FMOV_dx = FMOV_sw | SixtyFourBits | FP64
1208 // Conversion between fixed point and floating point.
1209 enum FPFixedPointConvertOp {
1210 FPFixedPointConvertFixed = 0x1E000000,
1211 FPFixedPointConvertFMask = 0x5F200000,
1212 FPFixedPointConvertMask = 0xFFFF0000,
1213 FCVTZS_fixed = FPFixedPointConvertFixed | 0x00180000,
1214 FCVTZS_ws_fixed = FCVTZS_fixed,
1215 FCVTZS_xs_fixed = FCVTZS_fixed | SixtyFourBits,
1216 FCVTZS_wd_fixed = FCVTZS_fixed | FP64,
1217 FCVTZS_xd_fixed = FCVTZS_fixed | SixtyFourBits | FP64,
1218 FCVTZU_fixed = FPFixedPointConvertFixed | 0x00190000,
1219 FCVTZU_ws_fixed = FCVTZU_fixed,
1220 FCVTZU_xs_fixed = FCVTZU_fixed | SixtyFourBits,
1221 FCVTZU_wd_fixed = FCVTZU_fixed | FP64,
1222 FCVTZU_xd_fixed = FCVTZU_fixed | SixtyFourBits | FP64,
1223 SCVTF_fixed = FPFixedPointConvertFixed | 0x00020000,
1224 SCVTF_sw_fixed = SCVTF_fixed,
1225 SCVTF_sx_fixed = SCVTF_fixed | SixtyFourBits,
1226 SCVTF_dw_fixed = SCVTF_fixed | FP64,
1227 SCVTF_dx_fixed = SCVTF_fixed | SixtyFourBits | FP64,
1228 UCVTF_fixed = FPFixedPointConvertFixed | 0x00030000,
1229 UCVTF_sw_fixed = UCVTF_fixed,
1230 UCVTF_sx_fixed = UCVTF_fixed | SixtyFourBits,
1231 UCVTF_dw_fixed = UCVTF_fixed | FP64,
1232 UCVTF_dx_fixed = UCVTF_fixed | SixtyFourBits | FP64
1235 // Unimplemented and unallocated instructions. These are defined to make fixed
1236 // bit assertion easier.
1237 enum UnimplementedOp {
1238 UnimplementedFixed = 0x00000000,
1239 UnimplementedFMask = 0x00000000
1242 enum UnallocatedOp {
1243 UnallocatedFixed = 0x00000000,
1244 UnallocatedFMask = 0x00000000
1247 } } // namespace v8::internal
1249 #endif // V8_ARM64_CONSTANTS_ARM64_H_