binaryen
binaryen copied to clipboard
simd seem to break --memory64-lowering
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.
I'm currently running into this issue. Do you know how much work might be involved to fix this?
@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.