Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Why is WebAssembly not supporting 256/512 SIMD registers?
1 point by kenarsa on May 14, 2024 | hide | past | favorite | 4 comments
Why is WebAssembly not supporting 256/512 SIMD registers?


Registers will keep growing. Rather than adding 512 bits to the spec, it's better to choose an abstraction that's portable across hardware, so that modules don't need to be recompiled every few years with the latest and greatest SIMD size.

There's a proposal called 'flexible-vectors' which is still in stage 1 (i.e. design phase). Its goal is length-agnostic SIMD.

https://github.com/WebAssembly/flexible-vectors


WebAssembly is an abstract machine. Is there something preventing WebAssembly implementations from translating the current SIMD WebAssembly to use longer native vectors if running on sufficiently capable hardware? There seems to be a bunch of publications about binary translation of simd code to different vector lengths: https://ieeexplore.ieee.org/document/7823830 https://dl.acm.org/doi/abs/10.1109/CGO.2006.27


I guess 128-bits is the max-width found on Arm/Neon. My question would be if wider registers > 138-bit on Intel/Amd will be used if avail ?


100% of AVX/AVX2 have 256 SIMD registers, and Arm also has non-NEON registers, which are 256/512. of course, this requires runtime detection, but that is ok because even for native code, people need to do that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: