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 #include "src/zone/zone-containers.h" | 10 #include "src/zone/zone-containers.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 #define WASM_INC_LOCAL_BYV(index, count) \ | 453 #define WASM_INC_LOCAL_BYV(index, count) \ |
454 kExprGetLocal, static_cast<byte>(index), kExprI8Const, \ | 454 kExprGetLocal, static_cast<byte>(index), kExprI8Const, \ |
455 static_cast<byte>(count), kExprI32Add, kExprTeeLocal, \ | 455 static_cast<byte>(count), kExprI32Add, kExprTeeLocal, \ |
456 static_cast<byte>(index) | 456 static_cast<byte>(index) |
457 #define WASM_INC_LOCAL_BY(index, count) \ | 457 #define WASM_INC_LOCAL_BY(index, count) \ |
458 kExprGetLocal, static_cast<byte>(index), kExprI8Const, \ | 458 kExprGetLocal, static_cast<byte>(index), kExprI8Const, \ |
459 static_cast<byte>(count), kExprI32Add, kExprSetLocal, \ | 459 static_cast<byte>(count), kExprI32Add, kExprSetLocal, \ |
460 static_cast<byte>(index) | 460 static_cast<byte>(index) |
461 #define WASM_UNOP(opcode, x) x, static_cast<byte>(opcode) | 461 #define WASM_UNOP(opcode, x) x, static_cast<byte>(opcode) |
462 #define WASM_BINOP(opcode, x, y) x, y, static_cast<byte>(opcode) | 462 #define WASM_BINOP(opcode, x, y) x, y, static_cast<byte>(opcode) |
| 463 #define WASM_SIMD_UNOP(opcode, x) x, kSimdPrefix, static_cast<byte>(opcode) |
463 #define WASM_SIMD_BINOP(opcode, x, y) \ | 464 #define WASM_SIMD_BINOP(opcode, x, y) \ |
464 x, y, kSimdPrefix, static_cast<byte>(opcode) | 465 x, y, kSimdPrefix, static_cast<byte>(opcode) |
465 | 466 |
466 //------------------------------------------------------------------------------ | 467 //------------------------------------------------------------------------------ |
467 // Int32 operations | 468 // Int32 operations |
468 //------------------------------------------------------------------------------ | 469 //------------------------------------------------------------------------------ |
469 #define WASM_I32_ADD(x, y) x, y, kExprI32Add | 470 #define WASM_I32_ADD(x, y) x, y, kExprI32Add |
470 #define WASM_I32_SUB(x, y) x, y, kExprI32Sub | 471 #define WASM_I32_SUB(x, y) x, y, kExprI32Sub |
471 #define WASM_I32_MUL(x, y) x, y, kExprI32Mul | 472 #define WASM_I32_MUL(x, y) x, y, kExprI32Mul |
472 #define WASM_I32_DIVS(x, y) x, y, kExprI32DivS | 473 #define WASM_I32_DIVS(x, y) x, y, kExprI32DivS |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 #define WASM_BRV(depth, val) val, kExprBr, static_cast<byte>(depth) | 672 #define WASM_BRV(depth, val) val, kExprBr, static_cast<byte>(depth) |
672 #define WASM_BRV_IF(depth, val, cond) \ | 673 #define WASM_BRV_IF(depth, val, cond) \ |
673 val, cond, kExprBrIf, static_cast<byte>(depth) | 674 val, cond, kExprBrIf, static_cast<byte>(depth) |
674 #define WASM_BRV_IFD(depth, val, cond) \ | 675 #define WASM_BRV_IFD(depth, val, cond) \ |
675 val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop | 676 val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop |
676 #define WASM_IFB(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd | 677 #define WASM_IFB(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd |
677 #define WASM_BR_TABLEV(val, key, count, ...) \ | 678 #define WASM_BR_TABLEV(val, key, count, ...) \ |
678 val, key, kExprBrTable, U32V_1(count), __VA_ARGS__ | 679 val, key, kExprBrTable, U32V_1(count), __VA_ARGS__ |
679 | 680 |
680 #endif // V8_WASM_MACRO_GEN_H_ | 681 #endif // V8_WASM_MACRO_GEN_H_ |
OLD | NEW |