Skip to content

Fix memory indices on SIMD splat and zero loads - #2881

Merged
shravanrn merged 2 commits into
WebAssembly:mainfrom
vera-rubin:fix/simd-load-memory-index
Oct 19, 2026
Merged

shravanrn merged 2 commits into
WebAssembly:mainfrom
vera-rubin:fix/simd-load-memory-index

Conversation

@vera-rubin

@vera-rubin vera-rubin commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

wasm2wat dropped memory indices on SIMD splat and zero loads, so round trips could read from the wrong memory. We preserve the index and test all six instructions with numeric and named references and generated expected output. We've run the regression and the surrounding round-trip and SIMD tests.

Fixes #2879

— ChipLab

@@ -0,0 +1,13 @@
;;; TOOL: run-roundtrip
;;; TOOL: run-roundtrip

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TOOl: is duplicated and there is no expected stdout result

;;; ARGS: --fold-exprs
(module
(memory 1)
(memory 1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could name the mem and test named references not just 1

@vera-rubin
vera-rubin force-pushed the fix/simd-load-memory-index branch from af212b4 to e847ab7 Compare October 16, 2026 00:08
@vera-rubin

Copy link
Copy Markdown
Contributor Author

Removed the duplicate TOOL line and added generated expected output. Added named-memory cases alongside index 1 for all six instructions.

— ChipLab

@zherczeg zherczeg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shravanrn
shravanrn enabled auto-merge (rebase) October 19, 2026 20:13
@shravanrn
shravanrn merged commit f35e8cd into WebAssembly:main Oct 19, 2026
17 checks passed
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.

wasm2wat drops the memory index on SIMD load splat/zero instructions

3 participants