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_IA32_INSTRUCTION_CODES_IA32_H_ 6 #define V8_COMPILER_IA32_INSTRUCTION_CODES_IA32_H_ 7 8 namespace v8 { 9 namespace internal { 10 namespace compiler { 11 12 // IA32-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(IA32Add) \ 16 V(IA32And) \ 17 V(IA32Cmp) \ 18 V(IA32Cmp16) \ 19 V(IA32Cmp8) \ 20 V(IA32Test) \ 21 V(IA32Test16) \ 22 V(IA32Test8) \ 23 V(IA32Or) \ 24 V(IA32Xor) \ 25 V(IA32Sub) \ 26 V(IA32Imul) \ 27 V(IA32ImulHigh) \ 28 V(IA32UmulHigh) \ 29 V(IA32Idiv) \ 30 V(IA32Udiv) \ 31 V(IA32Not) \ 32 V(IA32Neg) \ 33 V(IA32Shl) \ 34 V(IA32Shr) \ 35 V(IA32Sar) \ 36 V(IA32AddPair) \ 37 V(IA32SubPair) \ 38 V(IA32MulPair) \ 39 V(IA32ShlPair) \ 40 V(IA32ShrPair) \ 41 V(IA32SarPair) \ 42 V(IA32Ror) \ 43 V(IA32Lzcnt) \ 44 V(IA32Tzcnt) \ 45 V(IA32Popcnt) \ 46 V(SSEFloat32Cmp) \ 47 V(SSEFloat32Add) \ 48 V(SSEFloat32Sub) \ 49 V(SSEFloat32Mul) \ 50 V(SSEFloat32Div) \ 51 V(SSEFloat32Max) \ 52 V(SSEFloat32Min) \ 53 V(SSEFloat32Abs) \ 54 V(SSEFloat32Neg) \ 55 V(SSEFloat32Sqrt) \ 56 V(SSEFloat32Round) \ 57 V(SSEFloat64Cmp) \ 58 V(SSEFloat64Add) \ 59 V(SSEFloat64Sub) \ 60 V(SSEFloat64Mul) \ 61 V(SSEFloat64Div) \ 62 V(SSEFloat64Mod) \ 63 V(SSEFloat64Max) \ 64 V(SSEFloat64Min) \ 65 V(SSEFloat64Abs) \ 66 V(SSEFloat64Neg) \ 67 V(SSEFloat64Sqrt) \ 68 V(SSEFloat64Round) \ 69 V(SSEFloat32ToFloat64) \ 70 V(SSEFloat64ToFloat32) \ 71 V(SSEFloat32ToInt32) \ 72 V(SSEFloat32ToUint32) \ 73 V(SSEFloat64ToInt32) \ 74 V(SSEFloat64ToUint32) \ 75 V(SSEInt32ToFloat32) \ 76 V(SSEUint32ToFloat32) \ 77 V(SSEInt32ToFloat64) \ 78 V(SSEUint32ToFloat64) \ 79 V(SSEFloat64ExtractLowWord32) \ 80 V(SSEFloat64ExtractHighWord32) \ 81 V(SSEFloat64InsertLowWord32) \ 82 V(SSEFloat64InsertHighWord32) \ 83 V(SSEFloat64LoadLowWord32) \ 84 V(SSEFloat64SilenceNaN) \ 85 V(AVXFloat32Add) \ 86 V(AVXFloat32Sub) \ 87 V(AVXFloat32Mul) \ 88 V(AVXFloat32Div) \ 89 V(AVXFloat32Max) \ 90 V(AVXFloat32Min) \ 91 V(AVXFloat64Add) \ 92 V(AVXFloat64Sub) \ 93 V(AVXFloat64Mul) \ 94 V(AVXFloat64Div) \ 95 V(AVXFloat64Max) \ 96 V(AVXFloat64Min) \ 97 V(AVXFloat64Abs) \ 98 V(AVXFloat64Neg) \ 99 V(AVXFloat32Abs) \ 100 V(AVXFloat32Neg) \ 101 V(IA32Movsxbl) \ 102 V(IA32Movzxbl) \ 103 V(IA32Movb) \ 104 V(IA32Movsxwl) \ 105 V(IA32Movzxwl) \ 106 V(IA32Movw) \ 107 V(IA32Movl) \ 108 V(IA32Movss) \ 109 V(IA32Movsd) \ 110 V(IA32BitcastFI) \ 111 V(IA32BitcastIF) \ 112 V(IA32Lea) \ 113 V(IA32Push) \ 114 V(IA32PushFloat32) \ 115 V(IA32PushFloat64) \ 116 V(IA32Poke) \ 117 V(IA32StackCheck) \ 118 V(IA32Xchgb) \ 119 V(IA32Xchgw) \ 120 V(IA32Xchgl) 121 122 // Addressing modes represent the "shape" of inputs to an instruction. 123 // Many instructions support multiple addressing modes. Addressing modes 124 // are encoded into the InstructionCode of the instruction and tell the 125 // code generator after register allocation which assembler method to call. 126 // 127 // We use the following local notation for addressing modes: 128 // 129 // M = memory operand 130 // R = base register 131 // N = index register * N for N in {1, 2, 4, 8} 132 // I = immediate displacement (int32_t) 133 134 #define TARGET_ADDRESSING_MODE_LIST(V) \ 135 V(MR) /* [%r1 ] */ \ 136 V(MRI) /* [%r1 + K] */ \ 137 V(MR1) /* [%r1 + %r2*1 ] */ \ 138 V(MR2) /* [%r1 + %r2*2 ] */ \ 139 V(MR4) /* [%r1 + %r2*4 ] */ \ 140 V(MR8) /* [%r1 + %r2*8 ] */ \ 141 V(MR1I) /* [%r1 + %r2*1 + K] */ \ 142 V(MR2I) /* [%r1 + %r2*2 + K] */ \ 143 V(MR4I) /* [%r1 + %r2*3 + K] */ \ 144 V(MR8I) /* [%r1 + %r2*4 + K] */ \ 145 V(M1) /* [ %r2*1 ] */ \ 146 V(M2) /* [ %r2*2 ] */ \ 147 V(M4) /* [ %r2*4 ] */ \ 148 V(M8) /* [ %r2*8 ] */ \ 149 V(M1I) /* [ %r2*1 + K] */ \ 150 V(M2I) /* [ %r2*2 + K] */ \ 151 V(M4I) /* [ %r2*4 + K] */ \ 152 V(M8I) /* [ %r2*8 + K] */ \ 153 V(MI) /* [ K] */ 154 155 } // namespace compiler 156 } // namespace internal 157 } // namespace v8 158 159 #endif // V8_COMPILER_IA32_INSTRUCTION_CODES_IA32_H_ 160