Re:AVX512 intrinsics for JDK’s Arrays.sort methods
by arthur2e5 on Wednesday May 31, 2023 @10:06AM
(#36138589)
The best thing a current compiler can provide is probably replacing intrinsics with more conventional-looking things like GCC's Vector extensions[1] and C++'s simd<T>. Even then you'd need to do a little bit of union work for the cooler operations.
[1] https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html
Re:AVX512 intrinsics for JDK’s Arrays.sort methods
by inetknght on Wednesday May 31, 2023 @02:06PM
(#36141577)
I 100% agree that there's a lot of room for improvement here.
Re:AVX512 intrinsics for JDK’s Arrays.sort methods
by janwas on Thursday June 01, 2023 @01:03AM
(#36147739)
The union work turns out to be a lot because compiler extensions and simd<> barely support anything beyond operators.
Examples of what's missing: interleaved load/store, compress/expand, software AES/CLMUL, popcount, lzcnt, saturated add/sub, 128-bit compare/minmax, fixed-point mul, mask find/set, masked load/store, scatter/gather, reductions.
Highway supports those (and >200 operations in total) on all platforms.
Take it from experience: sure you can write high-level code that is SIMD-compatible. But the compiler is garbage at understanding the semantics and will write terrible SIMD code.