Re:Hardware Intrinsics in .NET 8
by Const-me on Tuesday December 19, 2023 @08:03AM
(#38694994)
Vector API is very far from being hardware intrinsics. Unfortunately for Java programmers, itβs merely a least common denominator of SIMD instructions across different ISAs. This makes the feature very limited by design, IMO borderline useless.
[ Parent
| on HN ]
Yeah while not great it is still a step in the right direction (giving control to the developer).
Before this in the OpenJDK the developer had exactly 0 control. You just wrote code and hoped JDK would slap in vectorization etc.
This depends on the implementation under the hood and I'd say that the ability to use SIMD even at less than peak efficiency is better than not being able to use it at all.
For some problems, sticking to the SIMD subset exposed to Java might be slower than no SIMD at all.
Example: https://news.ycombinator.com/item?id=36624240 The linked C++ code is easily portable to C# because hardware intrinsics, but not to Java because nothing similar to _mm256_sad_epu8 is available there.