1 // Copyright 2014 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. 4 5 #ifndef V8_COMPILER_BACKEND_MIPS_INSTRUCTION_CODES_MIPS_H_ 6 #define V8_COMPILER_BACKEND_MIPS_INSTRUCTION_CODES_MIPS_H_ 7 8 namespace v8 { 9 namespace internal { 10 namespace compiler { 11 12 // MIPS-specific opcodes that specify which assembly sequence to emit. 13 // Most opcodes specify a single instruction. 14 15 #define TARGET_ARCH_OPCODE_LIST(V) \ 16 V(MipsAdd) \ 17 V(MipsAddOvf) \ 18 V(MipsSub) \ 19 V(MipsSubOvf) \ 20 V(MipsMul) \ 21 V(MipsMulOvf) \ 22 V(MipsMulHigh) \ 23 V(MipsMulHighU) \ 24 V(MipsDiv) \ 25 V(MipsDivU) \ 26 V(MipsMod) \ 27 V(MipsModU) \ 28 V(MipsAnd) \ 29 V(MipsOr) \ 30 V(MipsNor) \ 31 V(MipsXor) \ 32 V(MipsClz) \ 33 V(MipsCtz) \ 34 V(MipsPopcnt) \ 35 V(MipsLsa) \ 36 V(MipsShl) \ 37 V(MipsShr) \ 38 V(MipsSar) \ 39 V(MipsShlPair) \ 40 V(MipsShrPair) \ 41 V(MipsSarPair) \ 42 V(MipsExt) \ 43 V(MipsIns) \ 44 V(MipsRor) \ 45 V(MipsMov) \ 46 V(MipsTst) \ 47 V(MipsCmp) \ 48 V(MipsCmpS) \ 49 V(MipsAddS) \ 50 V(MipsSubS) \ 51 V(MipsMulS) \ 52 V(MipsDivS) \ 53 V(MipsAbsS) \ 54 V(MipsSqrtS) \ 55 V(MipsMaxS) \ 56 V(MipsMinS) \ 57 V(MipsCmpD) \ 58 V(MipsAddD) \ 59 V(MipsSubD) \ 60 V(MipsMulD) \ 61 V(MipsDivD) \ 62 V(MipsModD) \ 63 V(MipsAbsD) \ 64 V(MipsSqrtD) \ 65 V(MipsMaxD) \ 66 V(MipsMinD) \ 67 V(MipsNegS) \ 68 V(MipsNegD) \ 69 V(MipsAddPair) \ 70 V(MipsSubPair) \ 71 V(MipsMulPair) \ 72 V(MipsMaddS) \ 73 V(MipsMaddD) \ 74 V(MipsMsubS) \ 75 V(MipsMsubD) \ 76 V(MipsFloat32RoundDown) \ 77 V(MipsFloat32RoundTruncate) \ 78 V(MipsFloat32RoundUp) \ 79 V(MipsFloat32RoundTiesEven) \ 80 V(MipsFloat64RoundDown) \ 81 V(MipsFloat64RoundTruncate) \ 82 V(MipsFloat64RoundUp) \ 83 V(MipsFloat64RoundTiesEven) \ 84 V(MipsCvtSD) \ 85 V(MipsCvtDS) \ 86 V(MipsTruncWD) \ 87 V(MipsRoundWD) \ 88 V(MipsFloorWD) \ 89 V(MipsCeilWD) \ 90 V(MipsTruncWS) \ 91 V(MipsRoundWS) \ 92 V(MipsFloorWS) \ 93 V(MipsCeilWS) \ 94 V(MipsTruncUwD) \ 95 V(MipsTruncUwS) \ 96 V(MipsCvtDW) \ 97 V(MipsCvtDUw) \ 98 V(MipsCvtSW) \ 99 V(MipsCvtSUw) \ 100 V(MipsLb) \ 101 V(MipsLbu) \ 102 V(MipsSb) \ 103 V(MipsLh) \ 104 V(MipsUlh) \ 105 V(MipsLhu) \ 106 V(MipsUlhu) \ 107 V(MipsSh) \ 108 V(MipsUsh) \ 109 V(MipsLw) \ 110 V(MipsUlw) \ 111 V(MipsSw) \ 112 V(MipsUsw) \ 113 V(MipsLwc1) \ 114 V(MipsUlwc1) \ 115 V(MipsSwc1) \ 116 V(MipsUswc1) \ 117 V(MipsLdc1) \ 118 V(MipsUldc1) \ 119 V(MipsSdc1) \ 120 V(MipsUsdc1) \ 121 V(MipsFloat64ExtractLowWord32) \ 122 V(MipsFloat64ExtractHighWord32) \ 123 V(MipsFloat64InsertLowWord32) \ 124 V(MipsFloat64InsertHighWord32) \ 125 V(MipsFloat64SilenceNaN) \ 126 V(MipsFloat32Max) \ 127 V(MipsFloat64Max) \ 128 V(MipsFloat32Min) \ 129 V(MipsFloat64Min) \ 130 V(MipsPush) \ 131 V(MipsPeek) \ 132 V(MipsStoreToStackSlot) \ 133 V(MipsByteSwap32) \ 134 V(MipsStackClaim) \ 135 V(MipsSeb) \ 136 V(MipsSeh) \ 137 V(MipsSync) \ 138 V(MipsS128Zero) \ 139 V(MipsI32x4Splat) \ 140 V(MipsI32x4ExtractLane) \ 141 V(MipsI32x4ReplaceLane) \ 142 V(MipsI32x4Add) \ 143 V(MipsI32x4Sub) \ 144 V(MipsF64x2Abs) \ 145 V(MipsF64x2Neg) \ 146 V(MipsF64x2Sqrt) \ 147 V(MipsF64x2Add) \ 148 V(MipsF64x2Sub) \ 149 V(MipsF64x2Mul) \ 150 V(MipsF64x2Div) \ 151 V(MipsF64x2Min) \ 152 V(MipsF64x2Max) \ 153 V(MipsF64x2Eq) \ 154 V(MipsF64x2Ne) \ 155 V(MipsF64x2Lt) \ 156 V(MipsF64x2Le) \ 157 V(MipsF64x2Pmin) \ 158 V(MipsF64x2Pmax) \ 159 V(MipsF64x2Ceil) \ 160 V(MipsF64x2Floor) \ 161 V(MipsF64x2Trunc) \ 162 V(MipsF64x2NearestInt) \ 163 V(MipsF64x2ConvertLowI32x4S) \ 164 V(MipsF64x2ConvertLowI32x4U) \ 165 V(MipsF64x2PromoteLowF32x4) \ 166 V(MipsI64x2Add) \ 167 V(MipsI64x2Sub) \ 168 V(MipsI64x2Mul) \ 169 V(MipsI64x2Neg) \ 170 V(MipsI64x2Shl) \ 171 V(MipsI64x2ShrS) \ 172 V(MipsI64x2ShrU) \ 173 V(MipsI64x2BitMask) \ 174 V(MipsI64x2Eq) \ 175 V(MipsI64x2Ne) \ 176 V(MipsI64x2GtS) \ 177 V(MipsI64x2GeS) \ 178 V(MipsI64x2Abs) \ 179 V(MipsI64x2SConvertI32x4Low) \ 180 V(MipsI64x2SConvertI32x4High) \ 181 V(MipsI64x2UConvertI32x4Low) \ 182 V(MipsI64x2UConvertI32x4High) \ 183 V(MipsI64x2ExtMulLowI32x4S) \ 184 V(MipsI64x2ExtMulHighI32x4S) \ 185 V(MipsI64x2ExtMulLowI32x4U) \ 186 V(MipsI64x2ExtMulHighI32x4U) \ 187 V(MipsF32x4Splat) \ 188 V(MipsF32x4ExtractLane) \ 189 V(MipsF32x4ReplaceLane) \ 190 V(MipsF32x4SConvertI32x4) \ 191 V(MipsF32x4UConvertI32x4) \ 192 V(MipsF32x4DemoteF64x2Zero) \ 193 V(MipsI32x4Mul) \ 194 V(MipsI32x4MaxS) \ 195 V(MipsI32x4MinS) \ 196 V(MipsI32x4Eq) \ 197 V(MipsI32x4Ne) \ 198 V(MipsI32x4Shl) \ 199 V(MipsI32x4ShrS) \ 200 V(MipsI32x4ShrU) \ 201 V(MipsI32x4MaxU) \ 202 V(MipsI32x4MinU) \ 203 V(MipsF64x2Splat) \ 204 V(MipsF64x2ExtractLane) \ 205 V(MipsF64x2ReplaceLane) \ 206 V(MipsF32x4Abs) \ 207 V(MipsF32x4Neg) \ 208 V(MipsF32x4Sqrt) \ 209 V(MipsF32x4RecipApprox) \ 210 V(MipsF32x4RecipSqrtApprox) \ 211 V(MipsF32x4Add) \ 212 V(MipsF32x4Sub) \ 213 V(MipsF32x4Mul) \ 214 V(MipsF32x4Div) \ 215 V(MipsF32x4Max) \ 216 V(MipsF32x4Min) \ 217 V(MipsF32x4Eq) \ 218 V(MipsF32x4Ne) \ 219 V(MipsF32x4Lt) \ 220 V(MipsF32x4Le) \ 221 V(MipsF32x4Pmin) \ 222 V(MipsF32x4Pmax) \ 223 V(MipsF32x4Ceil) \ 224 V(MipsF32x4Floor) \ 225 V(MipsF32x4Trunc) \ 226 V(MipsF32x4NearestInt) \ 227 V(MipsI32x4SConvertF32x4) \ 228 V(MipsI32x4UConvertF32x4) \ 229 V(MipsI32x4Neg) \ 230 V(MipsI32x4GtS) \ 231 V(MipsI32x4GeS) \ 232 V(MipsI32x4GtU) \ 233 V(MipsI32x4GeU) \ 234 V(MipsI32x4Abs) \ 235 V(MipsI32x4BitMask) \ 236 V(MipsI32x4DotI16x8S) \ 237 V(MipsI32x4ExtMulLowI16x8S) \ 238 V(MipsI32x4ExtMulHighI16x8S) \ 239 V(MipsI32x4ExtMulLowI16x8U) \ 240 V(MipsI32x4ExtMulHighI16x8U) \ 241 V(MipsI32x4TruncSatF64x2SZero) \ 242 V(MipsI32x4TruncSatF64x2UZero) \ 243 V(MipsI32x4ExtAddPairwiseI16x8S) \ 244 V(MipsI32x4ExtAddPairwiseI16x8U) \ 245 V(MipsI16x8Splat) \ 246 V(MipsI16x8ExtractLaneU) \ 247 V(MipsI16x8ExtractLaneS) \ 248 V(MipsI16x8ReplaceLane) \ 249 V(MipsI16x8Neg) \ 250 V(MipsI16x8Shl) \ 251 V(MipsI16x8ShrS) \ 252 V(MipsI16x8ShrU) \ 253 V(MipsI16x8Add) \ 254 V(MipsI16x8AddSatS) \ 255 V(MipsI16x8Sub) \ 256 V(MipsI16x8SubSatS) \ 257 V(MipsI16x8Mul) \ 258 V(MipsI16x8MaxS) \ 259 V(MipsI16x8MinS) \ 260 V(MipsI16x8Eq) \ 261 V(MipsI16x8Ne) \ 262 V(MipsI16x8GtS) \ 263 V(MipsI16x8GeS) \ 264 V(MipsI16x8AddSatU) \ 265 V(MipsI16x8SubSatU) \ 266 V(MipsI16x8MaxU) \ 267 V(MipsI16x8MinU) \ 268 V(MipsI16x8GtU) \ 269 V(MipsI16x8GeU) \ 270 V(MipsI16x8RoundingAverageU) \ 271 V(MipsI16x8Abs) \ 272 V(MipsI16x8BitMask) \ 273 V(MipsI16x8Q15MulRSatS) \ 274 V(MipsI16x8ExtMulLowI8x16S) \ 275 V(MipsI16x8ExtMulHighI8x16S) \ 276 V(MipsI16x8ExtMulLowI8x16U) \ 277 V(MipsI16x8ExtMulHighI8x16U) \ 278 V(MipsI16x8ExtAddPairwiseI8x16S) \ 279 V(MipsI16x8ExtAddPairwiseI8x16U) \ 280 V(MipsI8x16Splat) \ 281 V(MipsI8x16ExtractLaneU) \ 282 V(MipsI8x16ExtractLaneS) \ 283 V(MipsI8x16ReplaceLane) \ 284 V(MipsI8x16Neg) \ 285 V(MipsI8x16Shl) \ 286 V(MipsI8x16ShrS) \ 287 V(MipsI8x16Add) \ 288 V(MipsI8x16AddSatS) \ 289 V(MipsI8x16Sub) \ 290 V(MipsI8x16SubSatS) \ 291 V(MipsI8x16MaxS) \ 292 V(MipsI8x16MinS) \ 293 V(MipsI8x16Eq) \ 294 V(MipsI8x16Ne) \ 295 V(MipsI8x16GtS) \ 296 V(MipsI8x16GeS) \ 297 V(MipsI8x16ShrU) \ 298 V(MipsI8x16AddSatU) \ 299 V(MipsI8x16SubSatU) \ 300 V(MipsI8x16MaxU) \ 301 V(MipsI8x16MinU) \ 302 V(MipsI8x16GtU) \ 303 V(MipsI8x16GeU) \ 304 V(MipsI8x16RoundingAverageU) \ 305 V(MipsI8x16Abs) \ 306 V(MipsI8x16Popcnt) \ 307 V(MipsI8x16BitMask) \ 308 V(MipsS128And) \ 309 V(MipsS128Or) \ 310 V(MipsS128Xor) \ 311 V(MipsS128Not) \ 312 V(MipsS128Select) \ 313 V(MipsS128AndNot) \ 314 V(MipsI64x2AllTrue) \ 315 V(MipsI32x4AllTrue) \ 316 V(MipsI16x8AllTrue) \ 317 V(MipsI8x16AllTrue) \ 318 V(MipsV128AnyTrue) \ 319 V(MipsS32x4InterleaveRight) \ 320 V(MipsS32x4InterleaveLeft) \ 321 V(MipsS32x4PackEven) \ 322 V(MipsS32x4PackOdd) \ 323 V(MipsS32x4InterleaveEven) \ 324 V(MipsS32x4InterleaveOdd) \ 325 V(MipsS32x4Shuffle) \ 326 V(MipsS16x8InterleaveRight) \ 327 V(MipsS16x8InterleaveLeft) \ 328 V(MipsS16x8PackEven) \ 329 V(MipsS16x8PackOdd) \ 330 V(MipsS16x8InterleaveEven) \ 331 V(MipsS16x8InterleaveOdd) \ 332 V(MipsS16x4Reverse) \ 333 V(MipsS16x2Reverse) \ 334 V(MipsS8x16InterleaveRight) \ 335 V(MipsS8x16InterleaveLeft) \ 336 V(MipsS8x16PackEven) \ 337 V(MipsS8x16PackOdd) \ 338 V(MipsS8x16InterleaveEven) \ 339 V(MipsS8x16InterleaveOdd) \ 340 V(MipsI8x16Shuffle) \ 341 V(MipsI8x16Swizzle) \ 342 V(MipsS8x16Concat) \ 343 V(MipsS8x8Reverse) \ 344 V(MipsS8x4Reverse) \ 345 V(MipsS8x2Reverse) \ 346 V(MipsS128Load8Splat) \ 347 V(MipsS128Load16Splat) \ 348 V(MipsS128Load32Splat) \ 349 V(MipsS128Load64Splat) \ 350 V(MipsS128Load8x8S) \ 351 V(MipsS128Load8x8U) \ 352 V(MipsS128Load16x4S) \ 353 V(MipsS128Load16x4U) \ 354 V(MipsS128Load32x2S) \ 355 V(MipsS128Load32x2U) \ 356 V(MipsMsaLd) \ 357 V(MipsMsaSt) \ 358 V(MipsI32x4SConvertI16x8Low) \ 359 V(MipsI32x4SConvertI16x8High) \ 360 V(MipsI32x4UConvertI16x8Low) \ 361 V(MipsI32x4UConvertI16x8High) \ 362 V(MipsI16x8SConvertI8x16Low) \ 363 V(MipsI16x8SConvertI8x16High) \ 364 V(MipsI16x8SConvertI32x4) \ 365 V(MipsI16x8UConvertI32x4) \ 366 V(MipsI16x8UConvertI8x16Low) \ 367 V(MipsI16x8UConvertI8x16High) \ 368 V(MipsI8x16SConvertI16x8) \ 369 V(MipsI8x16UConvertI16x8) \ 370 V(MipsWord32AtomicPairLoad) \ 371 V(MipsWord32AtomicPairStore) \ 372 V(MipsWord32AtomicPairAdd) \ 373 V(MipsWord32AtomicPairSub) \ 374 V(MipsWord32AtomicPairAnd) \ 375 V(MipsWord32AtomicPairOr) \ 376 V(MipsWord32AtomicPairXor) \ 377 V(MipsWord32AtomicPairExchange) \ 378 V(MipsWord32AtomicPairCompareExchange) 379 380 // Addressing modes represent the "shape" of inputs to an instruction. 381 // Many instructions support multiple addressing modes. Addressing modes 382 // are encoded into the InstructionCode of the instruction and tell the 383 // code generator after register allocation which assembler method to call. 384 // 385 // We use the following local notation for addressing modes: 386 // 387 // R = register 388 // O = register or stack slot 389 // D = double register 390 // I = immediate (handle, external, int32) 391 // MRI = [register + immediate] 392 // MRR = [register + register] 393 // TODO(plind): Add the new r6 address modes. 394 #define TARGET_ADDRESSING_MODE_LIST(V) \ 395 V(MRI) /* [%r0 + K] */ \ 396 V(MRR) /* [%r0 + %r1] */ 397 398 } // namespace compiler 399 } // namespace internal 400 } // namespace v8 401 402 #endif // V8_COMPILER_BACKEND_MIPS_INSTRUCTION_CODES_MIPS_H_ 403