diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-01-04 14:54:50 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-04 14:54:50 -0500 |
| commit | 5087ec6f41ba928e14596e00822dc117aeb90a12 (patch) | |
| tree | 95d629f527158751b0828b274f96b5e32c924d12 /lib | |
| parent | 5c228765f1094d30e64d13c0077c67b2867ecd6a (diff) | |
| parent | 89b1fdc4437531776b46ed7133c44b7250c122f8 (diff) | |
| download | zig-5087ec6f41ba928e14596e00822dc117aeb90a12.tar.gz zig-5087ec6f41ba928e14596e00822dc117aeb90a12.zip | |
Merge pull request #10508 from Luukdegram/wasm-behavior-tests
Stage2: wasm - Pass more behavior tests
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/std/wasm.zig | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/std/wasm.zig b/lib/std/wasm.zig index 681ac405fc..9af0156239 100644 --- a/lib/std/wasm.zig +++ b/lib/std/wasm.zig @@ -212,6 +212,28 @@ test "Wasm - opcodes" { try testing.expectEqual(@as(u16, 0xC4), i64_extend32_s); } +/// Opcodes that require a prefix `0xFC` +pub const PrefixedOpcode = enum(u8) { + i32_trunc_sat_f32_s = 0x00, + i32_trunc_sat_f32_u = 0x01, + i32_trunc_sat_f64_s = 0x02, + i32_trunc_sat_f64_u = 0x03, + i64_trunc_sat_f32_s = 0x04, + i64_trunc_sat_f32_u = 0x05, + i64_trunc_sat_f64_s = 0x06, + i64_trunc_sat_f64_u = 0x07, + memory_init = 0x08, + data_drop = 0x09, + memory_copy = 0x0A, + memory_fill = 0x0B, + table_init = 0x0C, + elem_drop = 0x0D, + table_copy = 0x0E, + table_grow = 0x0F, + table_size = 0x10, + table_fill = 0x11, +}; + /// Enum representing all Wasm value types as per spec: /// https://webassembly.github.io/spec/core/binary/types.html pub const Valtype = enum(u8) { @@ -266,7 +288,7 @@ pub const InitExpression = union(enum) { global_get: u32, }; -/// +/// Represents a function entry, holding the index to its type pub const Func = struct { type_index: u32, }; |
