On Wed, 23 Apr 2025 18:11:42 GMT, Vladimir Ivanov <vliva...@openjdk.org> wrote:

>> In previous code, we use `UseRVV` to detect if rvv extension is supported.
>> 
>> On the other hand, user can choose to disable UseRVV if they want even if 
>> rvv extension is supported on the running machine. In this sense, there 
>> could be similar issue on other platforms?
>
> Does the following check catch `UseRVV == false` case on RISC-V? 
> 
> public boolean isSupported(Operator op, VectorSpecies<?> vspecies) {
> ...
>             int maxLaneCount = 
> VectorSupport.getMaxLaneCount(vspecies.elementType());
>             if (vspecies.length() > maxLaneCount) {
>                 return false; // lacking vector support
>             }
> ...

FTR both `VectorSupport.getMaxLaneCount()` and `CPUFeatures` don't rely on  raw 
list of ISA extensions CPU supports, but only those reported by the JVM. So, if 
some feature support is disabled on JVM side, it won't be reported by 
`VM_Version` and, hence, `CPUFeatures`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24462#discussion_r2057065571

Reply via email to