Analyzing the Vectorization Capability of the Java Vector API
Andrea Rosà, Matteo Basso, Walter Binder · 2024
The Java Vector API (JVA) is a novel feature of the Java Virtual Machine (JVM), allowing developers to express vector computations that are automatically translated to vector hardware instructions at runtime. This paper focuses on the vectorization capability of the API, which has not been studied by the literature yet. We investigate how effective the JVA is in automatically vectorizing scalar instructions, comparing it with the auto-vectorization capability of the HotSpot C2 compiler. Our results show that using the JVA results in much fewer (i.e., 79.62% on average on processors supporting AVX-512) instructions executed than using C2 auto-vectorization for carrying out the same work.