binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

simd seem to break --memory64-lowering

Open sbc100 opened this issue 3 years ago • 3 comments

If I take a simple SIMD test from emscripten and build with MEMORY64=2 (lowering) I get errors like this one:

$ wasm-opt --memory64-lowering --strip-producers in.wasm -o out.wasm -g --mvp-features --enable-simd --enable-memory64
[wasm-validator error in function main] i64 != i32: load_splat address must match memory index type, on 
(v128.load8_splat offset=79
 (local.get $4)
)
Fatal: error after opts

Without --memory64-lowering the above command work. I've attached in.wasm.

in.wasm.zip

sbc100 avatar May 03 '22 22:05 sbc100

I'm currently running into this issue. Do you know how much work might be involved to fix this?

warvstar avatar Jan 01 '24 23:01 warvstar

@warvstar it's a small amount of work per SIMD instruction, I believe. For example for SIMDLoad this would work, which is basically the same as for a normal Load,

  void visitSIMDLoad(SIMDLoad* curr) { wrapAddress64(curr->ptr, curr->memory); }

(and a test should be added here). There are a number of SIMD instructions, so covering them all is where most of the work is.

kripken avatar Jan 02 '24 17:01 kripken