On Wed, 15 Apr 2026 16:55:08 GMT, Vladimir Ivanov <[email protected]> wrote:

>> Good to know. Thanks for your explanation!
>
> The question is whether vector math stubs should be used or not when 
> corresponding vector shapes aren't supported. That's what the asserts were 
> about. The assumption was that the support is there when SVML stubs are used. 
> I'd prefer `VectorMathLibrary` to be adjusted to take 
> `VectorShape.getMaxVectorBitSize()` into account.

If we want to retain the asserts, they should be changed to:
            assert SUPPORTS_AVX512F == 
(VectorShape.getMaxVectorBitSize(int.class)   <= 512);
            assert SUPPORTS_AVX2    == 
(VectorShape.getMaxVectorBitSize(byte.class)   <= 256);
            assert SUPPORTS_AVX     == 
(VectorShape.getMaxVectorBitSize(float.class)   <= 256);


VectorShape.getMaxVectorBitSize is dependent on MaxVectorSize. MaxVectorSize is 
a JVM command line option and can be set by the user to be  a valid <= the cpu 
supported max.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/30015#discussion_r3090019197

Reply via email to