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_MACRO_GEN_H_ | 5 #ifndef V8_WASM_MACRO_GEN_H_ |
6 #define V8_WASM_MACRO_GEN_H_ | 6 #define V8_WASM_MACRO_GEN_H_ |
7 | 7 |
8 #include "src/wasm/wasm-opcodes.h" | 8 #include "src/wasm/wasm-opcodes.h" |
9 | 9 |
10 // Convenience macros for building Wasm bytecode directly into a byte array. | 10 // Convenience macros for building Wasm bytecode directly into a byte array. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 #define WASM_I32_DIVS(x, y) kExprI32DivS, x, y | 137 #define WASM_I32_DIVS(x, y) kExprI32DivS, x, y |
138 #define WASM_I32_DIVU(x, y) kExprI32DivU, x, y | 138 #define WASM_I32_DIVU(x, y) kExprI32DivU, x, y |
139 #define WASM_I32_REMS(x, y) kExprI32RemS, x, y | 139 #define WASM_I32_REMS(x, y) kExprI32RemS, x, y |
140 #define WASM_I32_REMU(x, y) kExprI32RemU, x, y | 140 #define WASM_I32_REMU(x, y) kExprI32RemU, x, y |
141 #define WASM_I32_AND(x, y) kExprI32And, x, y | 141 #define WASM_I32_AND(x, y) kExprI32And, x, y |
142 #define WASM_I32_IOR(x, y) kExprI32Ior, x, y | 142 #define WASM_I32_IOR(x, y) kExprI32Ior, x, y |
143 #define WASM_I32_XOR(x, y) kExprI32Xor, x, y | 143 #define WASM_I32_XOR(x, y) kExprI32Xor, x, y |
144 #define WASM_I32_SHL(x, y) kExprI32Shl, x, y | 144 #define WASM_I32_SHL(x, y) kExprI32Shl, x, y |
145 #define WASM_I32_SHR(x, y) kExprI32ShrU, x, y | 145 #define WASM_I32_SHR(x, y) kExprI32ShrU, x, y |
146 #define WASM_I32_SAR(x, y) kExprI32ShrS, x, y | 146 #define WASM_I32_SAR(x, y) kExprI32ShrS, x, y |
| 147 #define WASM_I32_ROR(x, y) kExprI32Ror, x, y |
| 148 #define WASM_I32_ROL(x, y) kExprI32Rol, x, y |
147 #define WASM_I32_EQ(x, y) kExprI32Eq, x, y | 149 #define WASM_I32_EQ(x, y) kExprI32Eq, x, y |
148 #define WASM_I32_NE(x, y) kExprI32Ne, x, y | 150 #define WASM_I32_NE(x, y) kExprI32Ne, x, y |
149 #define WASM_I32_LTS(x, y) kExprI32LtS, x, y | 151 #define WASM_I32_LTS(x, y) kExprI32LtS, x, y |
150 #define WASM_I32_LES(x, y) kExprI32LeS, x, y | 152 #define WASM_I32_LES(x, y) kExprI32LeS, x, y |
151 #define WASM_I32_LTU(x, y) kExprI32LtU, x, y | 153 #define WASM_I32_LTU(x, y) kExprI32LtU, x, y |
152 #define WASM_I32_LEU(x, y) kExprI32LeU, x, y | 154 #define WASM_I32_LEU(x, y) kExprI32LeU, x, y |
153 #define WASM_I32_GTS(x, y) kExprI32GtS, x, y | 155 #define WASM_I32_GTS(x, y) kExprI32GtS, x, y |
154 #define WASM_I32_GES(x, y) kExprI32GeS, x, y | 156 #define WASM_I32_GES(x, y) kExprI32GeS, x, y |
155 #define WASM_I32_GTU(x, y) kExprI32GtU, x, y | 157 #define WASM_I32_GTU(x, y) kExprI32GtU, x, y |
156 #define WASM_I32_GEU(x, y) kExprI32GeU, x, y | 158 #define WASM_I32_GEU(x, y) kExprI32GeU, x, y |
(...skipping 10 matching lines...) Expand all Loading... |
167 #define WASM_I64_DIVS(x, y) kExprI64DivS, x, y | 169 #define WASM_I64_DIVS(x, y) kExprI64DivS, x, y |
168 #define WASM_I64_DIVU(x, y) kExprI64DivU, x, y | 170 #define WASM_I64_DIVU(x, y) kExprI64DivU, x, y |
169 #define WASM_I64_REMS(x, y) kExprI64RemS, x, y | 171 #define WASM_I64_REMS(x, y) kExprI64RemS, x, y |
170 #define WASM_I64_REMU(x, y) kExprI64RemU, x, y | 172 #define WASM_I64_REMU(x, y) kExprI64RemU, x, y |
171 #define WASM_I64_AND(x, y) kExprI64And, x, y | 173 #define WASM_I64_AND(x, y) kExprI64And, x, y |
172 #define WASM_I64_IOR(x, y) kExprI64Ior, x, y | 174 #define WASM_I64_IOR(x, y) kExprI64Ior, x, y |
173 #define WASM_I64_XOR(x, y) kExprI64Xor, x, y | 175 #define WASM_I64_XOR(x, y) kExprI64Xor, x, y |
174 #define WASM_I64_SHL(x, y) kExprI64Shl, x, y | 176 #define WASM_I64_SHL(x, y) kExprI64Shl, x, y |
175 #define WASM_I64_SHR(x, y) kExprI64ShrU, x, y | 177 #define WASM_I64_SHR(x, y) kExprI64ShrU, x, y |
176 #define WASM_I64_SAR(x, y) kExprI64ShrS, x, y | 178 #define WASM_I64_SAR(x, y) kExprI64ShrS, x, y |
| 179 #define WASM_I64_ROR(x, y) kExprI64Ror, x, y |
| 180 #define WASM_I64_ROL(x, y) kExprI64Rol, x, y |
177 #define WASM_I64_EQ(x, y) kExprI64Eq, x, y | 181 #define WASM_I64_EQ(x, y) kExprI64Eq, x, y |
178 #define WASM_I64_NE(x, y) kExprI64Ne, x, y | 182 #define WASM_I64_NE(x, y) kExprI64Ne, x, y |
179 #define WASM_I64_LTS(x, y) kExprI64LtS, x, y | 183 #define WASM_I64_LTS(x, y) kExprI64LtS, x, y |
180 #define WASM_I64_LES(x, y) kExprI64LeS, x, y | 184 #define WASM_I64_LES(x, y) kExprI64LeS, x, y |
181 #define WASM_I64_LTU(x, y) kExprI64LtU, x, y | 185 #define WASM_I64_LTU(x, y) kExprI64LtU, x, y |
182 #define WASM_I64_LEU(x, y) kExprI64LeU, x, y | 186 #define WASM_I64_LEU(x, y) kExprI64LeU, x, y |
183 #define WASM_I64_GTS(x, y) kExprI64GtS, x, y | 187 #define WASM_I64_GTS(x, y) kExprI64GtS, x, y |
184 #define WASM_I64_GES(x, y) kExprI64GeS, x, y | 188 #define WASM_I64_GES(x, y) kExprI64GeS, x, y |
185 #define WASM_I64_GTU(x, y) kExprI64GtU, x, y | 189 #define WASM_I64_GTU(x, y) kExprI64GtU, x, y |
186 #define WASM_I64_GEU(x, y) kExprI64GeU, x, y | 190 #define WASM_I64_GEU(x, y) kExprI64GeU, x, y |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 static_cast<byte>(((x >> 14) & MASK_7) | 0x80), \ | 299 static_cast<byte>(((x >> 14) & MASK_7) | 0x80), \ |
296 static_cast<byte>((x >> 21) & MASK_7) | 300 static_cast<byte>((x >> 21) & MASK_7) |
297 #define U32V_5(x) \ | 301 #define U32V_5(x) \ |
298 static_cast<byte>((x & MASK_7) | 0x80), \ | 302 static_cast<byte>((x & MASK_7) | 0x80), \ |
299 static_cast<byte>(((x >> 7) & MASK_7) | 0x80), \ | 303 static_cast<byte>(((x >> 7) & MASK_7) | 0x80), \ |
300 static_cast<byte>(((x >> 14) & MASK_7) | 0x80), \ | 304 static_cast<byte>(((x >> 14) & MASK_7) | 0x80), \ |
301 static_cast<byte>(((x >> 21) & MASK_7) | 0x80), \ | 305 static_cast<byte>(((x >> 21) & MASK_7) | 0x80), \ |
302 static_cast<byte>((x >> 28) & 0xF) | 306 static_cast<byte>((x >> 28) & 0xF) |
303 | 307 |
304 #endif // V8_WASM_MACRO_GEN_H_ | 308 #endif // V8_WASM_MACRO_GEN_H_ |
OLD | NEW |