Skip to content

feat: spec-testsuite integration, optimizer spilling, i32.popcnt#56

Merged
avrabe merged 2 commits intomainfrom
feat/spec-testsuite-bazel-fixes
Mar 20, 2026
Merged

feat: spec-testsuite integration, optimizer spilling, i32.popcnt#56
avrabe merged 2 commits intomainfrom
feat/spec-testsuite-bazel-fixes

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Mar 20, 2026

Summary

Official WASM Spec Test Suite Integration

  • 76 wast_multi_func_test Bazel targets in tests/spec/BUILD.bazel
  • References 257-file WebAssembly/testsuite submodule
  • Categories: i32, i64, f32, f64, control flow, memory, tables, functions, data/bulk, traps, ref types
  • 194 of 257 spec files compile to ARM ELF (18,646 assertions)
  • --no-optimize flag added to macro for high register pressure files

Optimizer Register Spilling

  • Added spill-to-stack in optimizer_bridge.rs when all 9 temp registers are exhausted
  • Oldest live non-local vreg evicted via STR, reloaded into R12 scratch register
  • Spill frame prologue/epilogue (SUB SP/ADD SP) inserted as needed
  • Fixes panic in 8 spec files (block, loop, if, call, labels, ref_cast/eq/test)

i32.popcnt Instruction Selection

  • Wired existing Popcnt pseudo-op (parallel bit-count algorithm) to instruction selector
  • Previously returned error despite encoder already implementing the sequence

Test plan

  • cargo test --workspace — 766+ tests, 0 failures
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo fmt --check — clean
  • 194/257 spec files compile successfully

🤖 Generated with Claude Code

avrabe and others added 2 commits March 20, 2026 06:31
Optimizer register spilling:
- Added spill-to-stack when all 9 temp registers are exhausted
- Oldest live non-local vreg evicted to stack via STR/LDR
- Spill frame prologue/epilogue (SUB SP/ADD SP) inserted as needed
- Fixes panic in 8 spec files (block, loop, if, call, labels, ref_*)

i32.popcnt:
- Wired existing Popcnt pseudo-op to instruction selector
- Previously returned error despite encoder already implementing it

wast_multi_func_test macro:
- Added --no-optimize parameter support for heavy register pressure files

Implements: FR-002
Trace: skip

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
76 wast_multi_func_test targets organized by category: i32, i64, f32,
f64, control flow, memory, tables, functions, data/bulk, traps, and
reference types. References .wast files from the spec-testsuite
submodule via //tests/spec-testsuite: labels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 3c7d5eb into main Mar 20, 2026
6 checks passed
@avrabe avrabe deleted the feat/spec-testsuite-bazel-fixes branch March 20, 2026 06:04
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