instruction-codes-arm64.h 7.05 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_COMPILER_ARM64_INSTRUCTION_CODES_ARM64_H_
#define V8_COMPILER_ARM64_INSTRUCTION_CODES_ARM64_H_

namespace v8 {
namespace internal {
namespace compiler {

// ARM64-specific opcodes that specify which assembly sequence to emit.
// Most opcodes specify a single instruction.
#define TARGET_ARCH_OPCODE_LIST(V) \
  V(Arm64Add)                      \
  V(Arm64Add32)                    \
  V(Arm64And)                      \
  V(Arm64And32)                    \
19 20
  V(Arm64Bic)                      \
  V(Arm64Bic32)                    \
21
  V(Arm64Clz)                      \
22
  V(Arm64Clz32)                    \
23 24
  V(Arm64Cmp)                      \
  V(Arm64Cmp32)                    \
25 26
  V(Arm64Cmn)                      \
  V(Arm64Cmn32)                    \
27 28 29 30
  V(Arm64Tst)                      \
  V(Arm64Tst32)                    \
  V(Arm64Or)                       \
  V(Arm64Or32)                     \
31 32 33 34 35 36
  V(Arm64Orn)                      \
  V(Arm64Orn32)                    \
  V(Arm64Eor)                      \
  V(Arm64Eor32)                    \
  V(Arm64Eon)                      \
  V(Arm64Eon32)                    \
37 38 39 40
  V(Arm64Sub)                      \
  V(Arm64Sub32)                    \
  V(Arm64Mul)                      \
  V(Arm64Mul32)                    \
41
  V(Arm64Smull)                    \
42
  V(Arm64Umull)                    \
43 44 45 46 47 48
  V(Arm64Madd)                     \
  V(Arm64Madd32)                   \
  V(Arm64Msub)                     \
  V(Arm64Msub32)                   \
  V(Arm64Mneg)                     \
  V(Arm64Mneg32)                   \
49 50 51 52 53 54 55 56 57 58
  V(Arm64Idiv)                     \
  V(Arm64Idiv32)                   \
  V(Arm64Udiv)                     \
  V(Arm64Udiv32)                   \
  V(Arm64Imod)                     \
  V(Arm64Imod32)                   \
  V(Arm64Umod)                     \
  V(Arm64Umod32)                   \
  V(Arm64Not)                      \
  V(Arm64Not32)                    \
59 60 61 62 63 64
  V(Arm64Lsl)                      \
  V(Arm64Lsl32)                    \
  V(Arm64Lsr)                      \
  V(Arm64Lsr32)                    \
  V(Arm64Asr)                      \
  V(Arm64Asr32)                    \
65 66
  V(Arm64Ror)                      \
  V(Arm64Ror32)                    \
67
  V(Arm64Mov32)                    \
68 69
  V(Arm64Sxtb32)                   \
  V(Arm64Sxth32)                   \
70
  V(Arm64Sxtw)                     \
71
  V(Arm64Sbfx32)                   \
72 73
  V(Arm64Ubfx)                     \
  V(Arm64Ubfx32)                   \
74
  V(Arm64Ubfiz32)                  \
75
  V(Arm64Bfi)                      \
76 77
  V(Arm64Rbit)                     \
  V(Arm64Rbit32)                   \
78 79 80
  V(Arm64TestAndBranch32)          \
  V(Arm64TestAndBranch)            \
  V(Arm64CompareAndBranch32)       \
81
  V(Arm64CompareAndBranch)         \
82 83 84 85
  V(Arm64ClaimCSP)                 \
  V(Arm64ClaimJSSP)                \
  V(Arm64PokeCSP)                  \
  V(Arm64PokeJSSP)                 \
86
  V(Arm64PokePair)                 \
87 88 89 90 91
  V(Arm64Float32Cmp)               \
  V(Arm64Float32Add)               \
  V(Arm64Float32Sub)               \
  V(Arm64Float32Mul)               \
  V(Arm64Float32Div)               \
92
  V(Arm64Float32Abs)               \
93
  V(Arm64Float32Neg)               \
94
  V(Arm64Float32Sqrt)              \
95
  V(Arm64Float32RoundDown)         \
96 97
  V(Arm64Float32Max)               \
  V(Arm64Float32Min)               \
98 99 100 101 102 103
  V(Arm64Float64Cmp)               \
  V(Arm64Float64Add)               \
  V(Arm64Float64Sub)               \
  V(Arm64Float64Mul)               \
  V(Arm64Float64Div)               \
  V(Arm64Float64Mod)               \
104 105
  V(Arm64Float64Max)               \
  V(Arm64Float64Min)               \
106
  V(Arm64Float64Abs)               \
107
  V(Arm64Float64Neg)               \
108
  V(Arm64Float64Sqrt)              \
109
  V(Arm64Float64RoundDown)         \
110
  V(Arm64Float32RoundUp)           \
111
  V(Arm64Float64RoundUp)           \
112
  V(Arm64Float64RoundTiesAway)     \
113
  V(Arm64Float32RoundTruncate)     \
114
  V(Arm64Float64RoundTruncate)     \
115
  V(Arm64Float32RoundTiesEven)     \
116
  V(Arm64Float64RoundTiesEven)     \
117
  V(Arm64Float64SilenceNaN)        \
118 119
  V(Arm64Float32ToFloat64)         \
  V(Arm64Float64ToFloat32)         \
120
  V(Arm64Float32ToInt32)           \
121
  V(Arm64Float64ToInt32)           \
122
  V(Arm64Float32ToUint32)          \
123
  V(Arm64Float64ToUint32)          \
124
  V(Arm64Float32ToInt64)           \
125
  V(Arm64Float64ToInt64)           \
126
  V(Arm64Float32ToUint64)          \
127
  V(Arm64Float64ToUint64)          \
128
  V(Arm64Int32ToFloat32)           \
129
  V(Arm64Int32ToFloat64)           \
130
  V(Arm64Int64ToFloat32)           \
131
  V(Arm64Int64ToFloat64)           \
132
  V(Arm64Uint32ToFloat32)          \
133
  V(Arm64Uint32ToFloat64)          \
134
  V(Arm64Uint64ToFloat32)          \
135
  V(Arm64Uint64ToFloat64)          \
136 137 138 139
  V(Arm64Float64ExtractLowWord32)  \
  V(Arm64Float64ExtractHighWord32) \
  V(Arm64Float64InsertLowWord32)   \
  V(Arm64Float64InsertHighWord32)  \
140
  V(Arm64Float64MoveU64)           \
141
  V(Arm64U64MoveFloat64)           \
142 143
  V(Arm64LdrS)                     \
  V(Arm64StrS)                     \
144 145 146 147 148 149 150 151
  V(Arm64LdrD)                     \
  V(Arm64StrD)                     \
  V(Arm64Ldrb)                     \
  V(Arm64Ldrsb)                    \
  V(Arm64Strb)                     \
  V(Arm64Ldrh)                     \
  V(Arm64Ldrsh)                    \
  V(Arm64Strh)                     \
152
  V(Arm64Ldrsw)                    \
153 154 155
  V(Arm64LdrW)                     \
  V(Arm64StrW)                     \
  V(Arm64Ldr)                      \
156
  V(Arm64Str)
157 158 159 160 161 162 163 164 165 166 167 168 169 170

// Addressing modes represent the "shape" of inputs to an instruction.
// Many instructions support multiple addressing modes. Addressing modes
// are encoded into the InstructionCode of the instruction and tell the
// code generator after register allocation which assembler method to call.
//
// We use the following local notation for addressing modes:
//
// R = register
// O = register or stack slot
// D = double register
// I = immediate (handle, external, int32)
// MRI = [register + immediate]
// MRR = [register + register]
171 172 173 174 175 176 177 178 179 180
#define TARGET_ADDRESSING_MODE_LIST(V)                          \
  V(MRI)              /* [%r0 + K] */                           \
  V(MRR)              /* [%r0 + %r1] */                         \
  V(Operand2_R_LSL_I) /* %r0 LSL K */                           \
  V(Operand2_R_LSR_I) /* %r0 LSR K */                           \
  V(Operand2_R_ASR_I) /* %r0 ASR K */                           \
  V(Operand2_R_ROR_I) /* %r0 ROR K */                           \
  V(Operand2_R_UXTB)  /* %r0 UXTB (unsigned extend byte) */     \
  V(Operand2_R_UXTH)  /* %r0 UXTH (unsigned extend halfword) */ \
  V(Operand2_R_SXTB)  /* %r0 SXTB (signed extend byte) */       \
181 182
  V(Operand2_R_SXTH)  /* %r0 SXTH (signed extend halfword) */   \
  V(Operand2_R_SXTW)  /* %r0 SXTW (signed extend word) */
183

184 185
enum ResetJSSPAfterCall { kNoResetJSSP, kResetJSSP };

186
}  // namespace compiler
187
}  // namespace internal
188 189 190
}  // namespace v8

#endif  // V8_COMPILER_ARM64_INSTRUCTION_CODES_ARM64_H_