Skip to content

feat: i64 register pairs, globals/select, WAST pipeline + spec-testsuite#55

Merged
avrabe merged 1 commit intomainfrom
feat/i64-globals-wast-pipeline
Mar 19, 2026
Merged

feat: i64 register pairs, globals/select, WAST pipeline + spec-testsuite#55
avrabe merged 1 commit intomainfrom
feat/i64-globals-wast-pipeline

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Mar 19, 2026

Summary

i64 Register Pair Support (all 38 operations)

  • Arithmetic: ADDS/ADC (add), SUBS/SBC (sub), UMULL+MLA (mul)
  • Bitwise: AND/ORR/EOR on both halves
  • Comparisons: ORR+CMP (eqz), CMP-hi-then-lo (relational, signed+unsigned)
  • Shifts: funnel shift sequences (shl, shr_u, shr_s, rotl, rotr)
  • Division/Remainder: binary long division pseudo-ops (div_s, div_u, rem_s, rem_u)
  • Conversions: I64ExtendI32S (ASR docs: Archive obsolete documentation #31), I64ExtendI32U (MOV #0), I32WrapI64 (take low)
  • Memory: I64Load/Store (two consecutive LDR/STR at offset+0 and offset+4)
  • Constants: I64Const (MOVW+MOVT for each half)
  • 47 new tests (29 instruction selector + 18 encoder)

GlobalGet/GlobalSet

  • R9 as globals base register, LDR/STR with 4-byte stride
  • Both stack and non-stack instruction selection modes
  • 10 new tests

Select Instruction

  • CMP + MOV + SelectMove (IT EQ; MOV in Thumb-2) pattern
  • 3 new tests

WAST Test Pipeline

  • wast_multi_func_test Bazel macro replaces 2,480 lines of hand-crafted targets with 25 declarative calls
  • All 22 .wast files wired into renode_test pipeline
  • Compiles with --all-exports, tests all functions per module

Spec Test Suite

  • Added WebAssembly/testsuite as git submodule (257 .wast files)
  • ~20 files runnable today (i32 + control flow + locals), ~5 more with FPU

Rivet Artifacts

  • SWVER-006: GlobalGet/GlobalSet verification
  • SWVER-007: Select instruction verification

762 tests total (up from 687)

Test plan

  • cargo test --workspace — 762 tests, 0 failures
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo fmt --check — clean

🤖 Generated with Claude Code

i64 register pair support (all 38 operations):
- Arithmetic: ADDS/ADC, SUBS/SBC for add/sub; UMULL+MLA for mul
- Bitwise: AND/ORR/EOR on both halves
- Comparisons: ORR+CMP for eqz; CMP hi then lo for relational
- Shifts: funnel shift sequences for shl/shr_u/shr_s/rotl/rotr
- Division: binary long division pseudo-ops
- Conversions: extend (ASR #31), wrap (take low word), load/store pairs
- 47 new tests (29 instruction selector + 18 encoder)

GlobalGet/GlobalSet:
- R9 as globals base register, LDR/STR with 4-byte stride
- Both stack and non-stack instruction selection modes

Select instruction:
- CMP + MOV + SelectMove (IT EQ; MOV) pattern

WAST test pipeline:
- wast_multi_func_test Bazel macro replaces 2480 lines with 25 targets
- All 22 .wast files wired into renode_test pipeline
- Compiles with --all-exports, tests all functions per module

Spec test suite:
- Added WebAssembly/testsuite as git submodule (257 .wast files)
- ~20 files runnable today (i32 + control flow + locals)

762 tests total (up from 687), clippy clean, fmt clean.

Implements: FR-002
Implements: FR-005
Trace: skip

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 6ffb857 into main Mar 19, 2026
6 checks passed
@avrabe avrabe deleted the feat/i64-globals-wast-pipeline branch March 19, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant