4 ms·
Looking at the implementation, it is implemented in C++. I'd rather have an implementation using the new Vector API (still in incubation). It would be more Java
by anthony88 3y ago
Looking at the implementation, it is implemented in C++. I'd rather have an implementation using the new Vector API (still in incubation). It would be more Java like and provide a good demo for this new API.
- marginalia_nu 3y agoThis is an intrinsic JVM function though, not application code.
- anonymoushn 3y agoIt seems like you're saying you'd rather have a slower implementation given that a bunch of single instructions useful for this sort of thing aren't available in the Vector API and must be built from sequences of Vector methods that themselves must be implemented using multiple instructions.
- Kipters 3y agoI think he's referring to something similar to what .NET has been doing in the last few versions. They introduced a new Vector API that abstracts platform-specific SIMD instructions. The end result is the same, code using Vector128 will be directly compiled to equivalent AVX opcodes on x86/x64 and NEON on ARM* as if you would have written that directly, except that now you can add these kinds of optimizations across many architectures with a single codebase This [0] post by Stephen Toub goes in GREAT detail on that [0]: https://devblogs.microsoft.com/dotnet/performance_improvements_in_net_7/ https://devblogs.microsoft.com/dotnet/performance_improvemen... *I may get vector length wrong, but you get the idea
- anonymoushn 3y agoYou can just look up the IntVector API in the docs and see that there's no method corresponding to VCOMPRESSPS or whatever.
- Kipters 3y agoYou mean this IntVector[0], which I assume is the Java experimental API anthony88 was referring to, correct? If that operation being missing is a blocker, I feel there may be some middle ground other than implementing the whole thing in C++ (like adding it or fast tracking work on this API) [0]: https://docs.oracle.com/en/java/javase/19/docs/api/jdk.incubator.vector/jdk/incubator/vector/IntVector.html https://docs.oracle.com/en/java/javase/19/docs/api/jdk.incub...
- gergo_barany 3y agoThe compress operation being missing is not a blocker, since the compress operation is not missing: https://docs.oracle.com/en/java/javase/19/docs/api/jdk.incubator.vector/jdk/incubator/vector/IntVector.html#compress(jdk.incubator.vector.VectorMask) https://docs.oracle.com/en/java/javase/19/docs/api/jdk.incub...
- Kipters 3y agoI don't get the other user's point then
- gergo_barany 3y agoThe user didn't have a point, they just made something up about an API that they know nothing about.
- anonymoushn 3y agoHello, thanks for pointing out that I missed this one. It looks like the methods exposed may be sufficient for implementing a sort. I also looked for vpalignr and vpshufb which seem to be missing, but I'm open to the possibility that I have missed these as well.
- gergo_barany 3y ago
- mgaunard 3y agoThey just copied a library provided by Intel themselves. The folks on the JDK side probably didn't even research how to parallelize sort.
- e4m2 3y agoThe author of the PR works for Intel, though.
- pdhborges 3y agoWith the Vector API comming I don't see this PR going through. A light search on the OpenJDK mailing list found no discussion.