You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wasm2c/spec/simd_address.txt fails on non-x86 #2240
out-of-bounds accesses on Wasm must trap deterministically, but
wasm2c tries to use the MMU to detect out-of-bounds accesses and raise a signal, but this kind of side-effect isn't something the compiler cares to preserve if the load can otherwise be optizmed out, so
wasm2c needs to force the C compiler not to optimize out a load, which is done with an empty inline asm statement that marks the result of the load as "read,"
but (unlike with a 32-bit or 64-bit register), there's no architecture-independent way to describe a 128-bit SIMD register, so at present we only have this for SIMD on x86.
Personally, it's the latter. We do have a growing interest in WebAssembly in Fedora, so others might actually be interested. I'll ask the other SIG members.
Activity
keithw commentedon May 25, 2023
Thanks as always for these reports! I think this particular one is expected and "disclosed" here: https://github.com/WebAssembly/wabt/blob/main/src/template/wasm2c_simd.declarations.c#L6
The root issue here is that:
Would happily take a contribution of the appropriate asm for aarch64 (possibly "w" per https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html) if somebody is able to test and say it works... I do wish we had CI tests on aarch64 given the interest in this architecture.
sbc100 commentedon May 25, 2023
Should we update the TODO such that it will #warning or #error when building on unsupported arch?
Also, I guess we should skip these tests on those platforms too..
sbc100 commentedon May 25, 2023
@rathann do you actually care about using the SIMD support in wasm2c on arm64 or are you just interested in getting the tests to pass?
rathann commentedon May 26, 2023
Personally, it's the latter. We do have a growing interest in WebAssembly in Fedora, so others might actually be interested. I'll ask the other SIG members.
[-]wasm2c/spec/simd_address.txt fails on aarch64[/-][+]wasm2c/spec/simd_address.txt fails on non-x86[/+]rathann commentedon May 26, 2023
I see this on ppc64le and s390x, too.
rathann commentedon Feb 21, 2025
Looks like this is fixed on s390x, now that I'm running the tests using
cmake --target run-tests.SoniEx2 commentedon Feb 21, 2025
indeed, s390x doesn't use guard pages and falls back to range checking, while this issue only occurs with guard pages. #2545 would fix it everywhere.