On Wed, 16 Apr 2025 18:26:18 GMT, Vladimir Ivanov <vliva...@openjdk.org> wrote:
>> src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMathLibrary.java >> line 240: >> >>> 238: if (isAARCH64() && vspecies.vectorBitSize() > 128) { >>> 239: return false; // FIXME: SVE support only for MAX >>> shapes >>> 240: } >> >> SVE also supports operations for partial vector size, which means the vector >> size is smaller than MAX size. For example, if the max vector size of a SVE >> architecture is 512-bit, the FP vector operations with >> `VectorShape.S_256_BIT` are also supported. They are implemented with the >> same scalable math functions in SLEEF. >> >> Hence, I think this check and the assertion in line-198 can be removed. >> Thanks! > > How does it work now? The code in `generate_vector_math_stubs()` in > `stubGenerator_aarch64.cpp` only populates `VEC_SIZE_SCALABLE` shapes with > SVE versions. Please see the `addr` definition code in https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/vectorIntrinsics.cpp#L1877 . If queried `addr` returns `nullptr` for 256-bit vectors, and the arch supports scalable vector, then the `addr` will be assigned to the scalable ones. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24462#discussion_r2048052819