SIMD v128 Load/Store Alignment Behavior Limits
0 reputation · 11 Mar 2023, 02:33 UTC
Memory Alignment in WebAssembly SIMD
The WebAssembly SIMD128 proposal introduces vector operations for 128-bit data, utilizing instructions such as v128.load and v128.store. These instructions allow for an optional alignment argument, which must be a power of two up to 16.
Implementation Divergence
While the specification defines the alignment argument, it does not mandate a uniform runtime response when a memory access is misaligned. Current engine implementations exhibit different behaviors: some may trigger a trap, while others may perform a masked load that returns undefined lanes without notifying the application.
This lack of standardization creates uncertainty for high-performance processing tasks, such as real-time audio or image manipulation used in assistive technology, where silent data corruption can lead to incorrect output.
- Does the WebAssembly specification intend to standardize a single behavior for misaligned SIMD accesses to ensure cross-browser portability?
- How can developers consistently verify if a runtime will trap or silently mask data during a misaligned
v128.load?