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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 #define WASM_F64_REINTERPRET_I64(x) x, kExprF64ReinterpretI64 | 612 #define WASM_F64_REINTERPRET_I64(x) x, kExprF64ReinterpretI64 |
613 #define WASM_I32_REINTERPRET_F32(x) x, kExprI32ReinterpretF32 | 613 #define WASM_I32_REINTERPRET_F32(x) x, kExprI32ReinterpretF32 |
614 #define WASM_I64_REINTERPRET_F64(x) x, kExprI64ReinterpretF64 | 614 #define WASM_I64_REINTERPRET_F64(x) x, kExprI64ReinterpretF64 |
615 | 615 |
616 //------------------------------------------------------------------------------ | 616 //------------------------------------------------------------------------------ |
617 // Memory Operations. | 617 // Memory Operations. |
618 //------------------------------------------------------------------------------ | 618 //------------------------------------------------------------------------------ |
619 #define WASM_GROW_MEMORY(x) x, kExprGrowMemory, 0 | 619 #define WASM_GROW_MEMORY(x) x, kExprGrowMemory, 0 |
620 #define WASM_MEMORY_SIZE kExprMemorySize, 0 | 620 #define WASM_MEMORY_SIZE kExprMemorySize, 0 |
621 | 621 |
622 //------------------------------------------------------------------------------ | |
623 // Simd Operations. | |
624 //------------------------------------------------------------------------------ | |
625 // TODO(bbudge) Migrate these into tests. | |
626 #define WASM_SIMD_F32x4_SPLAT(x) \ | |
627 x, kSimdPrefix, static_cast<byte>(kExprF32x4Splat) | |
628 #define WASM_SIMD_F32x4_EXTRACT_LANE(lane, x) \ | |
629 x, kSimdPrefix, static_cast<byte>(kExprF32x4ExtractLane), \ | |
630 static_cast<byte>(lane) | |
631 #define WASM_SIMD_F32x4_REPLACE_LANE(lane, x, y) \ | |
632 x, y, kSimdPrefix, static_cast<byte>(kExprF32x4ReplaceLane), \ | |
633 static_cast<byte>(lane) | |
634 #define WASM_SIMD_F32x4_ADD(x, y) \ | |
635 x, y, kSimdPrefix, static_cast<byte>(kExprF32x4Add) | |
636 #define WASM_SIMD_F32x4_SUB(x, y) \ | |
637 x, y, kSimdPrefix, static_cast<byte>(kExprF32x4Sub) | |
638 | |
639 #define WASM_SIMD_I32x4_SPLAT(x) \ | |
640 x, kSimdPrefix, static_cast<byte>(kExprI32x4Splat) | |
641 #define WASM_SIMD_I32x4_EXTRACT_LANE(lane, x) \ | |
642 x, kSimdPrefix, static_cast<byte>(kExprI32x4ExtractLane), \ | |
643 static_cast<byte>(lane) | |
644 #define WASM_SIMD_I32x4_REPLACE_LANE(lane, x, y) \ | |
645 x, y, kSimdPrefix, static_cast<byte>(kExprI32x4ReplaceLane), \ | |
646 static_cast<byte>(lane) | |
647 #define WASM_SIMD_I32x4_ADD(x, y) \ | |
648 x, y, kSimdPrefix, static_cast<byte>(kExprI32x4Add) | |
649 #define WASM_SIMD_I32x4_SUB(x, y) \ | |
650 x, y, kSimdPrefix, static_cast<byte>(kExprI32x4Sub) | |
651 | |
652 #define SIG_ENTRY_v_v kWasmFunctionTypeForm, 0, 0 | 622 #define SIG_ENTRY_v_v kWasmFunctionTypeForm, 0, 0 |
653 #define SIZEOF_SIG_ENTRY_v_v 3 | 623 #define SIZEOF_SIG_ENTRY_v_v 3 |
654 | 624 |
655 #define SIG_ENTRY_v_x(a) kWasmFunctionTypeForm, 1, a, 0 | 625 #define SIG_ENTRY_v_x(a) kWasmFunctionTypeForm, 1, a, 0 |
656 #define SIG_ENTRY_v_xx(a, b) kWasmFunctionTypeForm, 2, a, b, 0 | 626 #define SIG_ENTRY_v_xx(a, b) kWasmFunctionTypeForm, 2, a, b, 0 |
657 #define SIG_ENTRY_v_xxx(a, b, c) kWasmFunctionTypeForm, 3, a, b, c, 0 | 627 #define SIG_ENTRY_v_xxx(a, b, c) kWasmFunctionTypeForm, 3, a, b, c, 0 |
658 #define SIZEOF_SIG_ENTRY_v_x 4 | 628 #define SIZEOF_SIG_ENTRY_v_x 4 |
659 #define SIZEOF_SIG_ENTRY_v_xx 5 | 629 #define SIZEOF_SIG_ENTRY_v_xx 5 |
660 #define SIZEOF_SIG_ENTRY_v_xxx 6 | 630 #define SIZEOF_SIG_ENTRY_v_xxx 6 |
661 | 631 |
662 #define SIG_ENTRY_x(r) kWasmFunctionTypeForm, 0, 1, r | 632 #define SIG_ENTRY_x(r) kWasmFunctionTypeForm, 0, 1, r |
663 #define SIG_ENTRY_x_x(r, a) kWasmFunctionTypeForm, 1, a, 1, r | 633 #define SIG_ENTRY_x_x(r, a) kWasmFunctionTypeForm, 1, a, 1, r |
664 #define SIG_ENTRY_x_xx(r, a, b) kWasmFunctionTypeForm, 2, a, b, 1, r | 634 #define SIG_ENTRY_x_xx(r, a, b) kWasmFunctionTypeForm, 2, a, b, 1, r |
665 #define SIG_ENTRY_x_xxx(r, a, b, c) kWasmFunctionTypeForm, 3, a, b, c, 1, r | 635 #define SIG_ENTRY_x_xxx(r, a, b, c) kWasmFunctionTypeForm, 3, a, b, c, 1, r |
666 #define SIZEOF_SIG_ENTRY_x 4 | 636 #define SIZEOF_SIG_ENTRY_x 4 |
667 #define SIZEOF_SIG_ENTRY_x_x 5 | 637 #define SIZEOF_SIG_ENTRY_x_x 5 |
668 #define SIZEOF_SIG_ENTRY_x_xx 6 | 638 #define SIZEOF_SIG_ENTRY_x_xx 6 |
669 #define SIZEOF_SIG_ENTRY_x_xxx 7 | 639 #define SIZEOF_SIG_ENTRY_x_xxx 7 |
670 | 640 |
671 #define WASM_BRV(depth, val) val, kExprBr, static_cast<byte>(depth) | 641 #define WASM_BRV(depth, val) val, kExprBr, static_cast<byte>(depth) |
672 #define WASM_BRV_IF(depth, val, cond) \ | 642 #define WASM_BRV_IF(depth, val, cond) \ |
673 val, cond, kExprBrIf, static_cast<byte>(depth) | 643 val, cond, kExprBrIf, static_cast<byte>(depth) |
674 #define WASM_BRV_IFD(depth, val, cond) \ | 644 #define WASM_BRV_IFD(depth, val, cond) \ |
675 val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop | 645 val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop |
676 #define WASM_IFB(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd | 646 #define WASM_IFB(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd |
677 #define WASM_BR_TABLEV(val, key, count, ...) \ | 647 #define WASM_BR_TABLEV(val, key, count, ...) \ |
678 val, key, kExprBrTable, U32V_1(count), __VA_ARGS__ | 648 val, key, kExprBrTable, U32V_1(count), __VA_ARGS__ |
679 | 649 |
680 #endif // V8_WASM_MACRO_GEN_H_ | 650 #endif // V8_WASM_MACRO_GEN_H_ |
OLD | NEW |