aboutsummaryrefslogtreecommitdiff
path: root/lib/std/wasm.zig
diff options
context:
space:
mode:
authorMichael Dusan <michael.dusan@gmail.com>2021-04-11 17:40:19 -0400
committerMichael Dusan <michael.dusan@gmail.com>2021-04-11 17:40:19 -0400
commit93cf9560b13619159efb3ca12eeeb13d6031ad85 (patch)
tree4b5857db65268b6e3a41fc436082da7b100647b6 /lib/std/wasm.zig
parent86b31394c9d73b0f753918cea4f08ce8d7a26119 (diff)
parent82a31aac9b955213f47ff3b2a2c7eb932fdbe294 (diff)
downloadzig-93cf9560b13619159efb3ca12eeeb13d6031ad85.tar.gz
zig-93cf9560b13619159efb3ca12eeeb13d6031ad85.zip
Merge remote-tracking branch 'origin/master' into llvm12
Diffstat (limited to 'lib/std/wasm.zig')
-rw-r--r--lib/std/wasm.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/std/wasm.zig b/lib/std/wasm.zig
index a04378d283..ad6b947f67 100644
--- a/lib/std/wasm.zig
+++ b/lib/std/wasm.zig
@@ -5,6 +5,8 @@
// and substantial portions of the software.
const testing = @import("std.zig").testing;
+// TODO: Add support for multi-byte ops (e.g. table operations)
+
/// Wasm instruction opcodes
///
/// All instructions are defined as per spec:
@@ -175,7 +177,7 @@ pub const Opcode = enum(u8) {
i32_reinterpret_f32 = 0xBC,
i64_reinterpret_f64 = 0xBD,
f32_reinterpret_i32 = 0xBE,
- i64_reinterpret_i64 = 0xBF,
+ f64_reinterpret_i64 = 0xBF,
i32_extend8_s = 0xC0,
i32_extend16_s = 0xC1,
i64_extend8_s = 0xC2,
@@ -278,3 +280,6 @@ pub const block_empty: u8 = 0x40;
// binary constants
pub const magic = [_]u8{ 0x00, 0x61, 0x73, 0x6D }; // \0asm
pub const version = [_]u8{ 0x01, 0x00, 0x00, 0x00 }; // version 1
+
+// Each wasm page size is 64kB
+pub const page_size = 64 * 1024;