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_PPC_INSTRUCTION_CODES_PPC_H_ 6 #define V8_COMPILER_BACKEND_PPC_INSTRUCTION_CODES_PPC_H_ 7 8 namespace v8 { 9 namespace internal { 10 namespace compiler { 11 12 // PPC-specific opcodes that specify which assembly sequence to emit. 13 // Most opcodes specify a single instruction. 14 #define TARGET_ARCH_OPCODE_LIST(V) \ 15 V(PPC_Peek) \ 16 V(PPC_Sync) \ 17 V(PPC_And) \ 18 V(PPC_AndComplement) \ 19 V(PPC_Or) \ 20 V(PPC_OrComplement) \ 21 V(PPC_Xor) \ 22 V(PPC_ShiftLeft32) \ 23 V(PPC_ShiftLeft64) \ 24 V(PPC_ShiftLeftPair) \ 25 V(PPC_ShiftRight32) \ 26 V(PPC_ShiftRight64) \ 27 V(PPC_ShiftRightPair) \ 28 V(PPC_ShiftRightAlg32) \ 29 V(PPC_ShiftRightAlg64) \ 30 V(PPC_ShiftRightAlgPair) \ 31 V(PPC_RotRight32) \ 32 V(PPC_RotRight64) \ 33 V(PPC_Not) \ 34 V(PPC_RotLeftAndMask32) \ 35 V(PPC_RotLeftAndClear64) \ 36 V(PPC_RotLeftAndClearLeft64) \ 37 V(PPC_RotLeftAndClearRight64) \ 38 V(PPC_Add32) \ 39 V(PPC_Add64) \ 40 V(PPC_AddWithOverflow32) \ 41 V(PPC_AddPair) \ 42 V(PPC_AddDouble) \ 43 V(PPC_Sub) \ 44 V(PPC_SubWithOverflow32) \ 45 V(PPC_SubPair) \ 46 V(PPC_SubDouble) \ 47 V(PPC_Mul32) \ 48 V(PPC_Mul32WithHigh32) \ 49 V(PPC_Mul64) \ 50 V(PPC_MulHigh32) \ 51 V(PPC_MulHighU32) \ 52 V(PPC_MulPair) \ 53 V(PPC_MulDouble) \ 54 V(PPC_Div32) \ 55 V(PPC_Div64) \ 56 V(PPC_DivU32) \ 57 V(PPC_DivU64) \ 58 V(PPC_DivDouble) \ 59 V(PPC_Mod32) \ 60 V(PPC_Mod64) \ 61 V(PPC_ModU32) \ 62 V(PPC_ModU64) \ 63 V(PPC_ModDouble) \ 64 V(PPC_Neg) \ 65 V(PPC_NegDouble) \ 66 V(PPC_SqrtDouble) \ 67 V(PPC_FloorDouble) \ 68 V(PPC_CeilDouble) \ 69 V(PPC_TruncateDouble) \ 70 V(PPC_RoundDouble) \ 71 V(PPC_MaxDouble) \ 72 V(PPC_MinDouble) \ 73 V(PPC_AbsDouble) \ 74 V(PPC_Cntlz32) \ 75 V(PPC_Cntlz64) \ 76 V(PPC_Popcnt32) \ 77 V(PPC_Popcnt64) \ 78 V(PPC_Cmp32) \ 79 V(PPC_Cmp64) \ 80 V(PPC_CmpDouble) \ 81 V(PPC_Tst32) \ 82 V(PPC_Tst64) \ 83 V(PPC_Push) \ 84 V(PPC_PushFrame) \ 85 V(PPC_StoreToStackSlot) \ 86 V(PPC_ExtendSignWord8) \ 87 V(PPC_ExtendSignWord16) \ 88 V(PPC_ExtendSignWord32) \ 89 V(PPC_Uint32ToUint64) \ 90 V(PPC_Int64ToInt32) \ 91 V(PPC_Int64ToFloat32) \ 92 V(PPC_Int64ToDouble) \ 93 V(PPC_Uint64ToFloat32) \ 94 V(PPC_Uint64ToDouble) \ 95 V(PPC_Int32ToFloat32) \ 96 V(PPC_Int32ToDouble) \ 97 V(PPC_Uint32ToFloat32) \ 98 V(PPC_Float32ToInt32) \ 99 V(PPC_Float32ToUint32) \ 100 V(PPC_Uint32ToDouble) \ 101 V(PPC_Float32ToDouble) \ 102 V(PPC_Float64SilenceNaN) \ 103 V(PPC_DoubleToInt32) \ 104 V(PPC_DoubleToUint32) \ 105 V(PPC_DoubleToInt64) \ 106 V(PPC_DoubleToUint64) \ 107 V(PPC_DoubleToFloat32) \ 108 V(PPC_DoubleExtractLowWord32) \ 109 V(PPC_DoubleExtractHighWord32) \ 110 V(PPC_DoubleInsertLowWord32) \ 111 V(PPC_DoubleInsertHighWord32) \ 112 V(PPC_DoubleConstruct) \ 113 V(PPC_BitcastInt32ToFloat32) \ 114 V(PPC_BitcastFloat32ToInt32) \ 115 V(PPC_BitcastInt64ToDouble) \ 116 V(PPC_BitcastDoubleToInt64) \ 117 V(PPC_LoadWordS8) \ 118 V(PPC_LoadWordU8) \ 119 V(PPC_LoadWordS16) \ 120 V(PPC_LoadWordU16) \ 121 V(PPC_LoadWordS32) \ 122 V(PPC_LoadWordU32) \ 123 V(PPC_LoadWord64) \ 124 V(PPC_LoadFloat32) \ 125 V(PPC_LoadDouble) \ 126 V(PPC_LoadSimd128) \ 127 V(PPC_StoreWord8) \ 128 V(PPC_StoreWord16) \ 129 V(PPC_StoreWord32) \ 130 V(PPC_StoreWord64) \ 131 V(PPC_StoreFloat32) \ 132 V(PPC_StoreDouble) \ 133 V(PPC_StoreSimd128) \ 134 V(PPC_ByteRev32) \ 135 V(PPC_ByteRev64) \ 136 V(PPC_CompressSigned) \ 137 V(PPC_CompressPointer) \ 138 V(PPC_CompressAny) \ 139 V(PPC_AtomicStoreUint8) \ 140 V(PPC_AtomicStoreUint16) \ 141 V(PPC_AtomicStoreWord32) \ 142 V(PPC_AtomicStoreWord64) \ 143 V(PPC_AtomicLoadUint8) \ 144 V(PPC_AtomicLoadUint16) \ 145 V(PPC_AtomicLoadWord32) \ 146 V(PPC_AtomicLoadWord64) \ 147 V(PPC_AtomicExchangeUint8) \ 148 V(PPC_AtomicExchangeUint16) \ 149 V(PPC_AtomicExchangeWord32) \ 150 V(PPC_AtomicExchangeWord64) \ 151 V(PPC_AtomicCompareExchangeUint8) \ 152 V(PPC_AtomicCompareExchangeUint16) \ 153 V(PPC_AtomicCompareExchangeWord32) \ 154 V(PPC_AtomicCompareExchangeWord64) \ 155 V(PPC_AtomicAddUint8) \ 156 V(PPC_AtomicAddUint16) \ 157 V(PPC_AtomicAddUint32) \ 158 V(PPC_AtomicAddUint64) \ 159 V(PPC_AtomicAddInt8) \ 160 V(PPC_AtomicAddInt16) \ 161 V(PPC_AtomicAddInt32) \ 162 V(PPC_AtomicAddInt64) \ 163 V(PPC_AtomicSubUint8) \ 164 V(PPC_AtomicSubUint16) \ 165 V(PPC_AtomicSubUint32) \ 166 V(PPC_AtomicSubUint64) \ 167 V(PPC_AtomicSubInt8) \ 168 V(PPC_AtomicSubInt16) \ 169 V(PPC_AtomicSubInt32) \ 170 V(PPC_AtomicSubInt64) \ 171 V(PPC_AtomicAndUint8) \ 172 V(PPC_AtomicAndUint16) \ 173 V(PPC_AtomicAndUint32) \ 174 V(PPC_AtomicAndUint64) \ 175 V(PPC_AtomicAndInt8) \ 176 V(PPC_AtomicAndInt16) \ 177 V(PPC_AtomicAndInt32) \ 178 V(PPC_AtomicAndInt64) \ 179 V(PPC_AtomicOrUint8) \ 180 V(PPC_AtomicOrUint16) \ 181 V(PPC_AtomicOrUint32) \ 182 V(PPC_AtomicOrUint64) \ 183 V(PPC_AtomicOrInt8) \ 184 V(PPC_AtomicOrInt16) \ 185 V(PPC_AtomicOrInt32) \ 186 V(PPC_AtomicOrInt64) \ 187 V(PPC_AtomicXorUint8) \ 188 V(PPC_AtomicXorUint16) \ 189 V(PPC_AtomicXorUint32) \ 190 V(PPC_AtomicXorUint64) \ 191 V(PPC_AtomicXorInt8) \ 192 V(PPC_AtomicXorInt16) \ 193 V(PPC_AtomicXorInt32) \ 194 V(PPC_AtomicXorInt64) \ 195 V(PPC_F64x2Splat) \ 196 V(PPC_F64x2ExtractLane) \ 197 V(PPC_F64x2ReplaceLane) \ 198 V(PPC_F64x2Add) \ 199 V(PPC_F64x2Sub) \ 200 V(PPC_F64x2Mul) \ 201 V(PPC_F64x2Eq) \ 202 V(PPC_F64x2Ne) \ 203 V(PPC_F64x2Le) \ 204 V(PPC_F64x2Lt) \ 205 V(PPC_F64x2Abs) \ 206 V(PPC_F64x2Neg) \ 207 V(PPC_F64x2Sqrt) \ 208 V(PPC_F64x2Qfma) \ 209 V(PPC_F64x2Qfms) \ 210 V(PPC_F64x2Div) \ 211 V(PPC_F64x2Min) \ 212 V(PPC_F64x2Max) \ 213 V(PPC_F64x2Ceil) \ 214 V(PPC_F64x2Floor) \ 215 V(PPC_F64x2Trunc) \ 216 V(PPC_F64x2NearestInt) \ 217 V(PPC_F32x4Splat) \ 218 V(PPC_F32x4ExtractLane) \ 219 V(PPC_F32x4ReplaceLane) \ 220 V(PPC_F32x4Add) \ 221 V(PPC_F32x4AddHoriz) \ 222 V(PPC_F32x4Sub) \ 223 V(PPC_F32x4Mul) \ 224 V(PPC_F32x4Eq) \ 225 V(PPC_F32x4Ne) \ 226 V(PPC_F32x4Lt) \ 227 V(PPC_F32x4Le) \ 228 V(PPC_F32x4Abs) \ 229 V(PPC_F32x4Neg) \ 230 V(PPC_F32x4RecipApprox) \ 231 V(PPC_F32x4RecipSqrtApprox) \ 232 V(PPC_F32x4Sqrt) \ 233 V(PPC_F32x4SConvertI32x4) \ 234 V(PPC_F32x4UConvertI32x4) \ 235 V(PPC_F32x4Div) \ 236 V(PPC_F32x4Min) \ 237 V(PPC_F32x4Max) \ 238 V(PPC_F32x4Ceil) \ 239 V(PPC_F32x4Floor) \ 240 V(PPC_F32x4Trunc) \ 241 V(PPC_F32x4NearestInt) \ 242 V(PPC_I64x2Splat) \ 243 V(PPC_I64x2ExtractLane) \ 244 V(PPC_I64x2ReplaceLane) \ 245 V(PPC_I64x2Add) \ 246 V(PPC_I64x2Sub) \ 247 V(PPC_I64x2Mul) \ 248 V(PPC_I64x2MinS) \ 249 V(PPC_I64x2MinU) \ 250 V(PPC_I64x2MaxS) \ 251 V(PPC_I64x2MaxU) \ 252 V(PPC_I64x2Eq) \ 253 V(PPC_I64x2Ne) \ 254 V(PPC_I64x2GtS) \ 255 V(PPC_I64x2GtU) \ 256 V(PPC_I64x2GeU) \ 257 V(PPC_I64x2GeS) \ 258 V(PPC_I64x2Shl) \ 259 V(PPC_I64x2ShrS) \ 260 V(PPC_I64x2ShrU) \ 261 V(PPC_I64x2Neg) \ 262 V(PPC_I32x4Splat) \ 263 V(PPC_I32x4ExtractLane) \ 264 V(PPC_I32x4ReplaceLane) \ 265 V(PPC_I32x4Add) \ 266 V(PPC_I32x4AddHoriz) \ 267 V(PPC_I32x4Sub) \ 268 V(PPC_I32x4Mul) \ 269 V(PPC_I32x4MinS) \ 270 V(PPC_I32x4MinU) \ 271 V(PPC_I32x4MaxS) \ 272 V(PPC_I32x4MaxU) \ 273 V(PPC_I32x4Eq) \ 274 V(PPC_I32x4Ne) \ 275 V(PPC_I32x4GtS) \ 276 V(PPC_I32x4GeS) \ 277 V(PPC_I32x4GtU) \ 278 V(PPC_I32x4GeU) \ 279 V(PPC_I32x4Shl) \ 280 V(PPC_I32x4ShrS) \ 281 V(PPC_I32x4ShrU) \ 282 V(PPC_I32x4Neg) \ 283 V(PPC_I32x4Abs) \ 284 V(PPC_I32x4SConvertF32x4) \ 285 V(PPC_I32x4UConvertF32x4) \ 286 V(PPC_I32x4SConvertI16x8Low) \ 287 V(PPC_I32x4SConvertI16x8High) \ 288 V(PPC_I32x4UConvertI16x8Low) \ 289 V(PPC_I32x4UConvertI16x8High) \ 290 V(PPC_I32x4BitMask) \ 291 V(PPC_I32x4DotI16x8S) \ 292 V(PPC_F32x4Qfma) \ 293 V(PPC_F32x4Qfms) \ 294 V(PPC_I16x8Splat) \ 295 V(PPC_I16x8ExtractLaneU) \ 296 V(PPC_I16x8ExtractLaneS) \ 297 V(PPC_I16x8ReplaceLane) \ 298 V(PPC_I16x8Add) \ 299 V(PPC_I16x8AddHoriz) \ 300 V(PPC_I16x8Sub) \ 301 V(PPC_I16x8Mul) \ 302 V(PPC_I16x8MinS) \ 303 V(PPC_I16x8MinU) \ 304 V(PPC_I16x8MaxS) \ 305 V(PPC_I16x8MaxU) \ 306 V(PPC_I16x8Eq) \ 307 V(PPC_I16x8Ne) \ 308 V(PPC_I16x8GtS) \ 309 V(PPC_I16x8GeS) \ 310 V(PPC_I16x8GtU) \ 311 V(PPC_I16x8GeU) \ 312 V(PPC_I16x8Shl) \ 313 V(PPC_I16x8ShrS) \ 314 V(PPC_I16x8ShrU) \ 315 V(PPC_I16x8Neg) \ 316 V(PPC_I16x8Abs) \ 317 V(PPC_I16x8SConvertI32x4) \ 318 V(PPC_I16x8UConvertI32x4) \ 319 V(PPC_I16x8SConvertI8x16Low) \ 320 V(PPC_I16x8SConvertI8x16High) \ 321 V(PPC_I16x8UConvertI8x16Low) \ 322 V(PPC_I16x8UConvertI8x16High) \ 323 V(PPC_I16x8AddSatS) \ 324 V(PPC_I16x8SubSatS) \ 325 V(PPC_I16x8AddSatU) \ 326 V(PPC_I16x8SubSatU) \ 327 V(PPC_I16x8RoundingAverageU) \ 328 V(PPC_I16x8BitMask) \ 329 V(PPC_I8x16Splat) \ 330 V(PPC_I8x16ExtractLaneU) \ 331 V(PPC_I8x16ExtractLaneS) \ 332 V(PPC_I8x16ReplaceLane) \ 333 V(PPC_I8x16Add) \ 334 V(PPC_I8x16Sub) \ 335 V(PPC_I8x16Mul) \ 336 V(PPC_I8x16MinS) \ 337 V(PPC_I8x16MinU) \ 338 V(PPC_I8x16MaxS) \ 339 V(PPC_I8x16MaxU) \ 340 V(PPC_I8x16Eq) \ 341 V(PPC_I8x16Ne) \ 342 V(PPC_I8x16GtS) \ 343 V(PPC_I8x16GeS) \ 344 V(PPC_I8x16GtU) \ 345 V(PPC_I8x16GeU) \ 346 V(PPC_I8x16Shl) \ 347 V(PPC_I8x16ShrS) \ 348 V(PPC_I8x16ShrU) \ 349 V(PPC_I8x16Neg) \ 350 V(PPC_I8x16Abs) \ 351 V(PPC_I8x16SConvertI16x8) \ 352 V(PPC_I8x16UConvertI16x8) \ 353 V(PPC_I8x16AddSatS) \ 354 V(PPC_I8x16SubSatS) \ 355 V(PPC_I8x16AddSatU) \ 356 V(PPC_I8x16SubSatU) \ 357 V(PPC_I8x16RoundingAverageU) \ 358 V(PPC_I8x16Shuffle) \ 359 V(PPC_I8x16Swizzle) \ 360 V(PPC_I8x16BitMask) \ 361 V(PPC_V64x2AnyTrue) \ 362 V(PPC_V32x4AnyTrue) \ 363 V(PPC_V16x8AnyTrue) \ 364 V(PPC_V8x16AnyTrue) \ 365 V(PPC_V64x2AllTrue) \ 366 V(PPC_V32x4AllTrue) \ 367 V(PPC_V16x8AllTrue) \ 368 V(PPC_V8x16AllTrue) \ 369 V(PPC_S128And) \ 370 V(PPC_S128Or) \ 371 V(PPC_S128Xor) \ 372 V(PPC_S128Zero) \ 373 V(PPC_S128Not) \ 374 V(PPC_S128Select) \ 375 V(PPC_S128AndNot) \ 376 V(PPC_StoreCompressTagged) \ 377 V(PPC_LoadDecompressTaggedSigned) \ 378 V(PPC_LoadDecompressTaggedPointer) \ 379 V(PPC_LoadDecompressAnyTagged) 380 381 // Addressing modes represent the "shape" of inputs to an instruction. 382 // Many instructions support multiple addressing modes. Addressing modes 383 // are encoded into the InstructionCode of the instruction and tell the 384 // code generator after register allocation which assembler method to call. 385 // 386 // We use the following local notation for addressing modes: 387 // 388 // R = register 389 // O = register or stack slot 390 // D = double register 391 // I = immediate (handle, external, int32) 392 // MRI = [register + immediate] 393 // MRR = [register + register] 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_PPC_INSTRUCTION_CODES_PPC_H_ 403