Add i64 support

Stack slots, locals and globals were already 8 bytes wide, so i64 is mostly
64-bit encodings of the existing i32 ops: constants, comparisons, arithmetic,
bitwise, shifts/rotates, div/rem (with zero and overflow traps), wrap/extend,
sign-extension ops, i64 loads/stores (incl. narrow forms) and 64-bit globals.
Adds examples/i64.wat, which self-checks and exits 0 on success.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
SpriteandClaude Sonnet 5.5 committed 2026-11-21 09:49:28 +00:00
1 parent 05488c9783
commit 4c4fa91dc9
6 files changed
+294 -126

No files matched your search

+5 -4
View File
@@ -29,8 +29,9 @@ can build the example.
## Supported subset
i32 only; locals, params, calls, block/loop/if/else/br/br_if/return, select/drop, i32
arithmetic/comparison/shift/rotate, one fixed-size linear memory (i32 loads/stores with
bounds checks, `memory.size`; `memory.grow` always returns -1), i32 globals, active data
segments. Not supported: i64/floats, tables/`call_indirect`, `br_table`, start function,
i32 and i64; locals, params, calls, block/loop/if/else/br/br_if/return, select/drop,
integer arithmetic/comparison/shift/rotate (i64 add/sub/mul/div/rem/and/or/xor/shifts/
comparisons, wrap/extend, sign-extension ops), one fixed-size linear memory (i32/i64 loads/stores incl. narrow
forms, with bounds checks, `memory.size`; `memory.grow` always returns -1), i32/i64 globals, active data
segments. Not supported: clz/ctz/popcnt, floats, tables/`call_indirect`, `br_table`, start function,
non-function imports. Input is assumed valid (`wasm-tools validate` it first).