OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_WASM_OPCODES_H_ | 5 #ifndef V8_WASM_OPCODES_H_ |
6 #define V8_WASM_OPCODES_H_ | 6 #define V8_WASM_OPCODES_H_ |
7 | 7 |
8 #include "src/globals.h" | 8 #include "src/globals.h" |
9 #include "src/machine-type.h" | 9 #include "src/machine-type.h" |
10 #include "src/signature.h" | 10 #include "src/signature.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 namespace wasm { | 14 namespace wasm { |
15 | 15 |
16 // Binary encoding of local types. | 16 // Binary encoding of local types. |
17 enum LocalTypeCode { | 17 enum LocalTypeCode { |
18 kLocalVoid = 0, | 18 kLocalVoid = 0x40, |
19 kLocalI32 = 1, | 19 kLocalI32 = 0x7f, |
20 kLocalI64 = 2, | 20 kLocalI64 = 0x7e, |
21 kLocalF32 = 3, | 21 kLocalF32 = 0x7d, |
22 kLocalF64 = 4, | 22 kLocalF64 = 0x7c, |
23 kLocalS128 = 5 | 23 kLocalS128 = 0x7b |
24 }; | 24 }; |
25 | 25 |
26 // Type code for multi-value block types. | 26 // Type code for multi-value block types. |
27 static const uint8_t kMultivalBlock = 0x41; | 27 static const uint8_t kMultivalBlock = 0x41; |
28 | 28 |
29 // We reuse the internal machine type to represent WebAssembly AST types. | 29 // We reuse the internal machine type to represent WebAssembly AST types. |
30 // A typedef improves readability without adding a whole new type system. | 30 // A typedef improves readability without adding a whole new type system. |
31 typedef MachineRepresentation LocalType; | 31 typedef MachineRepresentation LocalType; |
32 const LocalType kAstStmt = MachineRepresentation::kNone; | 32 const LocalType kAstStmt = MachineRepresentation::kNone; |
33 const LocalType kAstI32 = MachineRepresentation::kWord32; | 33 const LocalType kAstI32 = MachineRepresentation::kWord32; |
34 const LocalType kAstI64 = MachineRepresentation::kWord64; | 34 const LocalType kAstI64 = MachineRepresentation::kWord64; |
35 const LocalType kAstF32 = MachineRepresentation::kFloat32; | 35 const LocalType kAstF32 = MachineRepresentation::kFloat32; |
36 const LocalType kAstF64 = MachineRepresentation::kFloat64; | 36 const LocalType kAstF64 = MachineRepresentation::kFloat64; |
37 const LocalType kAstS128 = MachineRepresentation::kSimd128; | 37 const LocalType kAstS128 = MachineRepresentation::kSimd128; |
38 // We use kTagged here because kNone is already used by kAstStmt. | 38 // We use kTagged here because kNone is already used by kAstStmt. |
39 const LocalType kAstEnd = MachineRepresentation::kTagged; | 39 const LocalType kAstEnd = MachineRepresentation::kTagged; |
40 | 40 |
41 typedef Signature<LocalType> FunctionSig; | 41 typedef Signature<LocalType> FunctionSig; |
42 std::ostream& operator<<(std::ostream& os, const FunctionSig& function); | 42 std::ostream& operator<<(std::ostream& os, const FunctionSig& function); |
43 | 43 |
44 typedef Vector<const char> WasmName; | 44 typedef Vector<const char> WasmName; |
45 | 45 |
46 typedef int WasmCodePosition; | 46 typedef int WasmCodePosition; |
47 const WasmCodePosition kNoCodePosition = -1; | 47 const WasmCodePosition kNoCodePosition = -1; |
48 | 48 |
49 // Control expressions and blocks. | 49 // Control expressions and blocks. |
50 #define FOREACH_CONTROL_OPCODE(V) \ | 50 #define FOREACH_CONTROL_OPCODE(V) \ |
51 V(Unreachable, 0x00, _) \ | 51 V(Unreachable, 0x00, _) \ |
52 V(Block, 0x01, _) \ | 52 V(Nop, 0x01, _) \ |
53 V(Loop, 0x02, _) \ | 53 V(Block, 0x02, _) \ |
54 V(If, 0x03, _) \ | 54 V(Loop, 0x03, _) \ |
55 V(Else, 0x04, _) \ | 55 V(If, 0x004, _) \ |
56 V(Select, 0x05, _) \ | 56 V(Else, 0x05, _) \ |
57 V(Br, 0x06, _) \ | 57 V(Try, 0x06, _ /* eh_prototype */) \ |
58 V(BrIf, 0x07, _) \ | 58 V(Catch, 0x07, _ /* eh_prototype */) \ |
59 V(BrTable, 0x08, _) \ | 59 V(Throw, 0x08, _ /* eh_prototype */) \ |
60 V(Return, 0x09, _) \ | 60 V(End, 0x0b, _) \ |
61 V(Nop, 0x0a, _) \ | 61 V(Br, 0x0c, _) \ |
62 V(Throw, 0xfa, _) \ | 62 V(BrIf, 0x0d, _) \ |
63 V(Try, 0xfb, _) \ | 63 V(BrTable, 0x0e, _) \ |
64 V(Catch, 0xfe, _) \ | 64 V(Return, 0x0f, _) |
65 V(End, 0x0F, _) | |
66 | 65 |
67 // Constants, locals, globals, and calls. | 66 // Constants, locals, globals, and calls. |
68 #define FOREACH_MISC_OPCODE(V) \ | 67 #define FOREACH_MISC_OPCODE(V) \ |
69 V(I32Const, 0x10, _) \ | 68 V(CallFunction, 0x10, _) \ |
70 V(I64Const, 0x11, _) \ | 69 V(CallIndirect, 0x11, _) \ |
71 V(F64Const, 0x12, _) \ | 70 V(Drop, 0x1a, _) \ |
72 V(F32Const, 0x13, _) \ | 71 V(Select, 0x1b, _) \ |
73 V(GetLocal, 0x14, _) \ | 72 V(GetLocal, 0x20, _) \ |
74 V(SetLocal, 0x15, _) \ | 73 V(SetLocal, 0x21, _) \ |
75 V(TeeLocal, 0x19, _) \ | 74 V(TeeLocal, 0x22, _) \ |
76 V(Drop, 0x0b, _) \ | 75 V(GetGlobal, 0x23, _) \ |
77 V(CallFunction, 0x16, _) \ | 76 V(SetGlobal, 0x24, _) \ |
78 V(CallIndirect, 0x17, _) \ | 77 V(I32Const, 0x41, _) \ |
79 V(I8Const, 0xcb, _) \ | 78 V(I64Const, 0x42, _) \ |
80 V(GetGlobal, 0xbb, _) \ | 79 V(F32Const, 0x43, _) \ |
81 V(SetGlobal, 0xbc, _) | 80 V(F64Const, 0x44, _) \ |
81 V(I8Const, 0xcb, _ /* TODO(titzer): V8 specific, remove */) | |
82 | 82 |
83 // Load memory expressions. | 83 // Load memory expressions. |
84 #define FOREACH_LOAD_MEM_OPCODE(V) \ | 84 #define FOREACH_LOAD_MEM_OPCODE(V) \ |
85 V(I32LoadMem8S, 0x20, i_i) \ | 85 V(I32LoadMem, 0x28, i_i) \ |
86 V(I32LoadMem8U, 0x21, i_i) \ | 86 V(I64LoadMem, 0x29, l_i) \ |
87 V(I32LoadMem16S, 0x22, i_i) \ | 87 V(F32LoadMem, 0x2a, f_i) \ |
88 V(I32LoadMem16U, 0x23, i_i) \ | 88 V(F64LoadMem, 0x2b, d_i) \ |
89 V(I64LoadMem8S, 0x24, l_i) \ | 89 V(I32LoadMem8S, 0x2c, i_i) \ |
90 V(I64LoadMem8U, 0x25, l_i) \ | 90 V(I32LoadMem8U, 0x2d, i_i) \ |
91 V(I64LoadMem16S, 0x26, l_i) \ | 91 V(I32LoadMem16S, 0x2e, i_i) \ |
92 V(I64LoadMem16U, 0x27, l_i) \ | 92 V(I32LoadMem16U, 0x2f, i_i) \ |
93 V(I64LoadMem32S, 0x28, l_i) \ | 93 V(I64LoadMem8S, 0x30, l_i) \ |
94 V(I64LoadMem32U, 0x29, l_i) \ | 94 V(I64LoadMem8U, 0x31, l_i) \ |
95 V(I32LoadMem, 0x2a, i_i) \ | 95 V(I64LoadMem16S, 0x32, l_i) \ |
96 V(I64LoadMem, 0x2b, l_i) \ | 96 V(I64LoadMem16U, 0x33, l_i) \ |
97 V(F32LoadMem, 0x2c, f_i) \ | 97 V(I64LoadMem32S, 0x34, l_i) \ |
98 V(F64LoadMem, 0x2d, d_i) | 98 V(I64LoadMem32U, 0x35, l_i) |
99 | 99 |
100 // Store memory expressions. | 100 // Store memory expressions. |
101 #define FOREACH_STORE_MEM_OPCODE(V) \ | 101 #define FOREACH_STORE_MEM_OPCODE(V) \ |
102 V(I32StoreMem8, 0x2e, i_ii) \ | 102 V(I32StoreMem, 0x36, i_ii) \ |
103 V(I32StoreMem16, 0x2f, i_ii) \ | 103 V(I64StoreMem, 0x37, l_il) \ |
104 V(I64StoreMem8, 0x30, l_il) \ | 104 V(F32StoreMem, 0x38, f_if) \ |
105 V(I64StoreMem16, 0x31, l_il) \ | 105 V(F64StoreMem, 0x39, d_id) \ |
106 V(I64StoreMem32, 0x32, l_il) \ | 106 V(I32StoreMem8, 0x3a, i_ii) \ |
107 V(I32StoreMem, 0x33, i_ii) \ | 107 V(I32StoreMem16, 0x3b, i_ii) \ |
108 V(I64StoreMem, 0x34, l_il) \ | 108 V(I64StoreMem8, 0x3c, l_il) \ |
109 V(F32StoreMem, 0x35, f_if) \ | 109 V(I64StoreMem16, 0x3d, l_il) \ |
110 V(F64StoreMem, 0x36, d_id) | 110 V(I64StoreMem32, 0x3e, l_il) |
111 | 111 |
112 #define FOREACH_SIMPLE_MEM_OPCODE(V) V(GrowMemory, 0x39, i_i) | 112 // Miscellaneous memory expressions |
113 | |
114 // Load memory expressions. | |
115 #define FOREACH_MISC_MEM_OPCODE(V) \ | 113 #define FOREACH_MISC_MEM_OPCODE(V) \ |
116 V(MemorySize, 0x3b, i_v) | 114 V(MemorySize, 0x3f, i_v) \ |
115 V(GrowMemory, 0x40, i_i) | |
117 | 116 |
118 // Expressions with signatures. | 117 // Expressions with signatures. |
119 #define FOREACH_SIMPLE_OPCODE(V) \ | 118 #define FOREACH_SIMPLE_OPCODE(V) \ |
120 V(I32Add, 0x40, i_ii) \ | 119 V(I32Eqz, 0x45, i_i) \ |
121 V(I32Sub, 0x41, i_ii) \ | 120 V(I32Eq, 0x46, i_ii) \ |
122 V(I32Mul, 0x42, i_ii) \ | 121 V(I32Ne, 0x47, i_ii) \ |
123 V(I32DivS, 0x43, i_ii) \ | 122 V(I32LtS, 0x48, i_ii) \ |
rossberg
2016/10/21 11:41:23
The order of comparisons has changed such that _S
titzer
2016/10/21 12:29:39
Done.
| |
124 V(I32DivU, 0x44, i_ii) \ | 123 V(I32LeS, 0x49, i_ii) \ |
125 V(I32RemS, 0x45, i_ii) \ | 124 V(I32LtU, 0x4a, i_ii) \ |
126 V(I32RemU, 0x46, i_ii) \ | 125 V(I32LeU, 0x4b, i_ii) \ |
127 V(I32And, 0x47, i_ii) \ | 126 V(I32GtS, 0x4c, i_ii) \ |
128 V(I32Ior, 0x48, i_ii) \ | 127 V(I32GeS, 0x4d, i_ii) \ |
129 V(I32Xor, 0x49, i_ii) \ | 128 V(I32GtU, 0x4e, i_ii) \ |
130 V(I32Shl, 0x4a, i_ii) \ | 129 V(I32GeU, 0x4f, i_ii) \ |
131 V(I32ShrU, 0x4b, i_ii) \ | 130 V(I64Eqz, 0x50, i_l) \ |
132 V(I32ShrS, 0x4c, i_ii) \ | 131 V(I64Eq, 0x51, i_ll) \ |
133 V(I32Eq, 0x4d, i_ii) \ | 132 V(I64Ne, 0x52, i_ll) \ |
134 V(I32Ne, 0x4e, i_ii) \ | 133 V(I64LtS, 0x53, i_ll) \ |
rossberg
2016/10/21 11:41:23
Same here.
titzer
2016/10/21 12:29:39
Done.
| |
135 V(I32LtS, 0x4f, i_ii) \ | 134 V(I64LeS, 0x54, i_ll) \ |
136 V(I32LeS, 0x50, i_ii) \ | 135 V(I64LtU, 0x55, i_ll) \ |
137 V(I32LtU, 0x51, i_ii) \ | 136 V(I64LeU, 0x56, i_ll) \ |
138 V(I32LeU, 0x52, i_ii) \ | 137 V(I64GtS, 0x57, i_ll) \ |
139 V(I32GtS, 0x53, i_ii) \ | 138 V(I64GeS, 0x58, i_ll) \ |
140 V(I32GeS, 0x54, i_ii) \ | 139 V(I64GtU, 0x59, i_ll) \ |
141 V(I32GtU, 0x55, i_ii) \ | 140 V(I64GeU, 0x5a, i_ll) \ |
142 V(I32GeU, 0x56, i_ii) \ | 141 V(F32Eq, 0x5b, i_ff) \ |
143 V(I32Clz, 0x57, i_i) \ | 142 V(F32Ne, 0x5c, i_ff) \ |
144 V(I32Ctz, 0x58, i_i) \ | 143 V(F32Lt, 0x5d, i_ff) \ |
145 V(I32Popcnt, 0x59, i_i) \ | 144 V(F32Le, 0x5e, i_ff) \ |
rossberg
2016/10/21 11:41:23
Switch this and the next one.
titzer
2016/10/21 12:29:39
Done.
| |
146 V(I32Eqz, 0x5a, i_i) \ | 145 V(F32Gt, 0x5f, i_ff) \ |
147 V(I64Add, 0x5b, l_ll) \ | 146 V(F32Ge, 0x60, i_ff) \ |
148 V(I64Sub, 0x5c, l_ll) \ | 147 V(F64Eq, 0x61, i_dd) \ |
149 V(I64Mul, 0x5d, l_ll) \ | 148 V(F64Ne, 0x62, i_dd) \ |
150 V(I64DivS, 0x5e, l_ll) \ | 149 V(F64Lt, 0x63, i_dd) \ |
151 V(I64DivU, 0x5f, l_ll) \ | 150 V(F64Le, 0x64, i_dd) \ |
rossberg
2016/10/21 11:41:23
Same here.
titzer
2016/10/21 12:29:39
Done.
| |
152 V(I64RemS, 0x60, l_ll) \ | 151 V(F64Gt, 0x65, i_dd) \ |
153 V(I64RemU, 0x61, l_ll) \ | 152 V(F64Ge, 0x66, i_dd) \ |
154 V(I64And, 0x62, l_ll) \ | 153 V(I32Clz, 0x67, i_i) \ |
155 V(I64Ior, 0x63, l_ll) \ | 154 V(I32Ctz, 0x68, i_i) \ |
156 V(I64Xor, 0x64, l_ll) \ | 155 V(I32Popcnt, 0x69, i_i) \ |
157 V(I64Shl, 0x65, l_ll) \ | 156 V(I32Add, 0x6a, i_ii) \ |
158 V(I64ShrU, 0x66, l_ll) \ | 157 V(I32Sub, 0x6b, i_ii) \ |
159 V(I64ShrS, 0x67, l_ll) \ | 158 V(I32Mul, 0x6c, i_ii) \ |
160 V(I64Eq, 0x68, i_ll) \ | 159 V(I32DivS, 0x6d, i_ii) \ |
161 V(I64Ne, 0x69, i_ll) \ | 160 V(I32DivU, 0x6e, i_ii) \ |
162 V(I64LtS, 0x6a, i_ll) \ | 161 V(I32RemS, 0x6f, i_ii) \ |
163 V(I64LeS, 0x6b, i_ll) \ | 162 V(I32RemU, 0x70, i_ii) \ |
164 V(I64LtU, 0x6c, i_ll) \ | 163 V(I32And, 0x71, i_ii) \ |
165 V(I64LeU, 0x6d, i_ll) \ | 164 V(I32Ior, 0x72, i_ii) \ |
166 V(I64GtS, 0x6e, i_ll) \ | 165 V(I32Xor, 0x73, i_ii) \ |
167 V(I64GeS, 0x6f, i_ll) \ | 166 V(I32Shl, 0x74, i_ii) \ |
168 V(I64GtU, 0x70, i_ll) \ | 167 V(I32ShrS, 0x75, i_ii) \ |
169 V(I64GeU, 0x71, i_ll) \ | 168 V(I32ShrU, 0x76, i_ii) \ |
170 V(I64Clz, 0x72, l_l) \ | 169 V(I32Rol, 0x77, i_ii) \ |
171 V(I64Ctz, 0x73, l_l) \ | 170 V(I32Ror, 0x78, i_ii) \ |
172 V(I64Popcnt, 0x74, l_l) \ | 171 V(I64Clz, 0x79, l_l) \ |
173 V(I64Eqz, 0xba, i_l) \ | 172 V(I64Ctz, 0x7a, l_l) \ |
174 V(F32Add, 0x75, f_ff) \ | 173 V(I64Popcnt, 0x7b, l_l) \ |
175 V(F32Sub, 0x76, f_ff) \ | 174 V(I64Add, 0x7c, l_ll) \ |
176 V(F32Mul, 0x77, f_ff) \ | 175 V(I64Sub, 0x7d, l_ll) \ |
177 V(F32Div, 0x78, f_ff) \ | 176 V(I64Mul, 0x7e, l_ll) \ |
178 V(F32Min, 0x79, f_ff) \ | 177 V(I64DivS, 0x7f, l_ll) \ |
179 V(F32Max, 0x7a, f_ff) \ | 178 V(I64DivU, 0x80, l_ll) \ |
180 V(F32Abs, 0x7b, f_f) \ | 179 V(I64RemS, 0x81, l_ll) \ |
181 V(F32Neg, 0x7c, f_f) \ | 180 V(I64RemU, 0x82, l_ll) \ |
182 V(F32CopySign, 0x7d, f_ff) \ | 181 V(I64And, 0x83, l_ll) \ |
183 V(F32Ceil, 0x7e, f_f) \ | 182 V(I64Ior, 0x84, l_ll) \ |
184 V(F32Floor, 0x7f, f_f) \ | 183 V(I64Xor, 0x85, l_ll) \ |
185 V(F32Trunc, 0x80, f_f) \ | 184 V(I64Shl, 0x86, l_ll) \ |
186 V(F32NearestInt, 0x81, f_f) \ | 185 V(I64ShrS, 0x87, l_ll) \ |
187 V(F32Sqrt, 0x82, f_f) \ | 186 V(I64ShrU, 0x88, l_ll) \ |
188 V(F32Eq, 0x83, i_ff) \ | 187 V(I64Rol, 0x89, l_ll) \ |
189 V(F32Ne, 0x84, i_ff) \ | 188 V(I64Ror, 0x8a, l_ll) \ |
190 V(F32Lt, 0x85, i_ff) \ | 189 V(F32Abs, 0x8b, f_f) \ |
191 V(F32Le, 0x86, i_ff) \ | 190 V(F32Neg, 0x8c, f_f) \ |
192 V(F32Gt, 0x87, i_ff) \ | 191 V(F32CopySign, 0x8d, f_ff) \ |
193 V(F32Ge, 0x88, i_ff) \ | 192 V(F32Ceil, 0x8e, f_f) \ |
194 V(F64Add, 0x89, d_dd) \ | 193 V(F32Floor, 0x8f, f_f) \ |
195 V(F64Sub, 0x8a, d_dd) \ | 194 V(F32Trunc, 0x90, f_f) \ |
196 V(F64Mul, 0x8b, d_dd) \ | 195 V(F32NearestInt, 0x91, f_f) \ |
197 V(F64Div, 0x8c, d_dd) \ | 196 V(F32Sqrt, 0x92, f_f) \ |
198 V(F64Min, 0x8d, d_dd) \ | 197 V(F32Add, 0x93, f_ff) \ |
199 V(F64Max, 0x8e, d_dd) \ | 198 V(F32Sub, 0x94, f_ff) \ |
200 V(F64Abs, 0x8f, d_d) \ | 199 V(F32Mul, 0x95, f_ff) \ |
201 V(F64Neg, 0x90, d_d) \ | 200 V(F32Div, 0x96, f_ff) \ |
202 V(F64CopySign, 0x91, d_dd) \ | 201 V(F32Min, 0x97, f_ff) \ |
203 V(F64Ceil, 0x92, d_d) \ | 202 V(F32Max, 0x98, f_ff) \ |
204 V(F64Floor, 0x93, d_d) \ | 203 V(F64Abs, 0x99, d_d) \ |
205 V(F64Trunc, 0x94, d_d) \ | 204 V(F64Neg, 0x9a, d_d) \ |
206 V(F64NearestInt, 0x95, d_d) \ | 205 V(F64CopySign, 0x9b, d_dd) \ |
207 V(F64Sqrt, 0x96, d_d) \ | 206 V(F64Ceil, 0x9c, d_d) \ |
208 V(F64Eq, 0x97, i_dd) \ | 207 V(F64Floor, 0x9d, d_d) \ |
209 V(F64Ne, 0x98, i_dd) \ | 208 V(F64Trunc, 0x9e, d_d) \ |
210 V(F64Lt, 0x99, i_dd) \ | 209 V(F64NearestInt, 0x9f, d_d) \ |
211 V(F64Le, 0x9a, i_dd) \ | 210 V(F64Sqrt, 0xa0, d_d) \ |
212 V(F64Gt, 0x9b, i_dd) \ | 211 V(F64Add, 0xa1, d_dd) \ |
213 V(F64Ge, 0x9c, i_dd) \ | 212 V(F64Sub, 0xa2, d_dd) \ |
214 V(I32SConvertF32, 0x9d, i_f) \ | 213 V(F64Mul, 0xa3, d_dd) \ |
215 V(I32SConvertF64, 0x9e, i_d) \ | 214 V(F64Div, 0xa4, d_dd) \ |
216 V(I32UConvertF32, 0x9f, i_f) \ | 215 V(F64Min, 0xa5, d_dd) \ |
217 V(I32UConvertF64, 0xa0, i_d) \ | 216 V(F64Max, 0xa6, d_dd) \ |
218 V(I32ConvertI64, 0xa1, i_l) \ | 217 V(I32ConvertI64, 0xa7, i_l) \ |
219 V(I64SConvertF32, 0xa2, l_f) \ | 218 V(I32SConvertF32, 0xa8, i_f) \ |
220 V(I64SConvertF64, 0xa3, l_d) \ | 219 V(I32UConvertF32, 0xa9, i_f) \ |
221 V(I64UConvertF32, 0xa4, l_f) \ | 220 V(I32SConvertF64, 0xaa, i_d) \ |
222 V(I64UConvertF64, 0xa5, l_d) \ | 221 V(I32UConvertF64, 0xab, i_d) \ |
223 V(I64SConvertI32, 0xa6, l_i) \ | 222 V(I64SConvertI32, 0xac, l_i) \ |
224 V(I64UConvertI32, 0xa7, l_i) \ | 223 V(I64UConvertI32, 0xad, l_i) \ |
225 V(F32SConvertI32, 0xa8, f_i) \ | 224 V(I64SConvertF32, 0xae, l_f) \ |
226 V(F32UConvertI32, 0xa9, f_i) \ | 225 V(I64UConvertF32, 0xaf, l_f) \ |
227 V(F32SConvertI64, 0xaa, f_l) \ | 226 V(I64SConvertF64, 0xb0, l_d) \ |
228 V(F32UConvertI64, 0xab, f_l) \ | 227 V(I64UConvertF64, 0xb1, l_d) \ |
229 V(F32ConvertF64, 0xac, f_d) \ | 228 V(F32SConvertI32, 0xb2, f_i) \ |
230 V(F32ReinterpretI32, 0xad, f_i) \ | 229 V(F32UConvertI32, 0xb3, f_i) \ |
231 V(F64SConvertI32, 0xae, d_i) \ | 230 V(F32SConvertI64, 0xb4, f_l) \ |
232 V(F64UConvertI32, 0xaf, d_i) \ | 231 V(F32UConvertI64, 0xb5, f_l) \ |
233 V(F64SConvertI64, 0xb0, d_l) \ | 232 V(F32ConvertF64, 0xb6, f_d) \ |
234 V(F64UConvertI64, 0xb1, d_l) \ | 233 V(F64SConvertI32, 0xb7, d_i) \ |
235 V(F64ConvertF32, 0xb2, d_f) \ | 234 V(F64UConvertI32, 0xb8, d_i) \ |
236 V(F64ReinterpretI64, 0xb3, d_l) \ | 235 V(F64SConvertI64, 0xb9, d_l) \ |
237 V(I32ReinterpretF32, 0xb4, i_f) \ | 236 V(F64UConvertI64, 0xba, d_l) \ |
238 V(I64ReinterpretF64, 0xb5, l_d) \ | 237 V(F64ConvertF32, 0xbb, d_f) \ |
239 V(I32Ror, 0xb6, i_ii) \ | 238 V(I32ReinterpretF32, 0xbc, i_f) \ |
240 V(I32Rol, 0xb7, i_ii) \ | 239 V(I64ReinterpretF64, 0xbd, l_d) \ |
241 V(I64Ror, 0xb8, l_ll) \ | 240 V(F32ReinterpretI32, 0xbe, f_i) \ |
242 V(I64Rol, 0xb9, l_ll) | 241 V(F64ReinterpretI64, 0xbf, d_l) |
243 | 242 |
244 // For compatibility with Asm.js. | 243 // For compatibility with Asm.js. |
245 #define FOREACH_ASMJS_COMPAT_OPCODE(V) \ | 244 #define FOREACH_ASMJS_COMPAT_OPCODE(V) \ |
246 V(F64Acos, 0xc0, d_d) \ | 245 V(F64Acos, 0xc0, d_d) \ |
247 V(F64Asin, 0xc1, d_d) \ | 246 V(F64Asin, 0xc1, d_d) \ |
248 V(F64Atan, 0xc2, d_d) \ | 247 V(F64Atan, 0xc2, d_d) \ |
249 V(F64Cos, 0xc3, d_d) \ | 248 V(F64Cos, 0xc3, d_d) \ |
250 V(F64Sin, 0xc4, d_d) \ | 249 V(F64Sin, 0xc4, d_d) \ |
251 V(F64Tan, 0xc5, d_d) \ | 250 V(F64Tan, 0xc5, d_d) \ |
252 V(F64Exp, 0xc6, d_d) \ | 251 V(F64Exp, 0xc6, d_d) \ |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
399 V(F32x4ExtractLane, 0xe501, _) \ | 398 V(F32x4ExtractLane, 0xe501, _) \ |
400 V(I32x4ExtractLane, 0xe51c, _) \ | 399 V(I32x4ExtractLane, 0xe51c, _) \ |
401 V(I16x8ExtractLane, 0xe539, _) \ | 400 V(I16x8ExtractLane, 0xe539, _) \ |
402 V(I8x16ExtractLane, 0xe558, _) | 401 V(I8x16ExtractLane, 0xe558, _) |
403 | 402 |
404 // All opcodes. | 403 // All opcodes. |
405 #define FOREACH_OPCODE(V) \ | 404 #define FOREACH_OPCODE(V) \ |
406 FOREACH_CONTROL_OPCODE(V) \ | 405 FOREACH_CONTROL_OPCODE(V) \ |
407 FOREACH_MISC_OPCODE(V) \ | 406 FOREACH_MISC_OPCODE(V) \ |
408 FOREACH_SIMPLE_OPCODE(V) \ | 407 FOREACH_SIMPLE_OPCODE(V) \ |
409 FOREACH_SIMPLE_MEM_OPCODE(V) \ | |
410 FOREACH_STORE_MEM_OPCODE(V) \ | 408 FOREACH_STORE_MEM_OPCODE(V) \ |
411 FOREACH_LOAD_MEM_OPCODE(V) \ | 409 FOREACH_LOAD_MEM_OPCODE(V) \ |
412 FOREACH_MISC_MEM_OPCODE(V) \ | 410 FOREACH_MISC_MEM_OPCODE(V) \ |
413 FOREACH_ASMJS_COMPAT_OPCODE(V) \ | 411 FOREACH_ASMJS_COMPAT_OPCODE(V) \ |
414 FOREACH_SIMD_0_OPERAND_OPCODE(V) \ | 412 FOREACH_SIMD_0_OPERAND_OPCODE(V) \ |
415 FOREACH_SIMD_1_OPERAND_OPCODE(V) | 413 FOREACH_SIMD_1_OPERAND_OPCODE(V) |
416 | 414 |
417 // All signatures. | 415 // All signatures. |
418 #define FOREACH_SIGNATURE(V) \ | 416 #define FOREACH_SIGNATURE(V) \ |
419 FOREACH_SIMD_SIGNATURE(V) \ | 417 FOREACH_SIMD_SIGNATURE(V) \ |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
641 default: | 639 default: |
642 return "<unknown>"; | 640 return "<unknown>"; |
643 } | 641 } |
644 } | 642 } |
645 }; | 643 }; |
646 } // namespace wasm | 644 } // namespace wasm |
647 } // namespace internal | 645 } // namespace internal |
648 } // namespace v8 | 646 } // namespace v8 |
649 | 647 |
650 #endif // V8_WASM_OPCODES_H_ | 648 #endif // V8_WASM_OPCODES_H_ |
OLD | NEW |