RFR: 8367103: RISC-V: store cpu features in a bitmap [v4]

Hamlin Li mli at openjdk.org
Mon Sep 22 08:32:09 UTC 2025


On Mon, 22 Sep 2025 07:17:58 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix typo
>
> src/hotspot/cpu/riscv/vm_version_riscv.hpp line 238:
> 
>> 236:   decl(ext_Zvfh         ,  Zvfh        ,  RV_NO_FLAG_BIT,  30,  true ,  UPDATE_DEFAULT_DEP(UseZvfh, ext_V)) \
>> 237:   decl(ext_Zvkn         ,  Zvkn        ,  RV_NO_FLAG_BIT,  31,  true ,  UPDATE_DEFAULT_DEP(UseZvkn, ext_V)) \
>> 238:   decl(ext_Zicond       ,  Zicond      ,  RV_NO_FLAG_BIT,  32,  true ,  UPDATE_DEFAULT(UseZicond))          \
> 
> I assume the `cpu feature index` field is not subject to change in the future when we have AOT support, right? Then I think the code will be cleaner if we group these features in aphabetic order before that.

There is dependency between some extensions, which enforce some order not subject to this constraint. So, not sure if it's an good idea to force the aphabetic order, especailly in this pr.
If you think it's necessary to do so, I can do it in another separate pr, and I hope to do it after https://github.com/openjdk/jdk/pull/27171.

> src/hotspot/cpu/riscv/vm_version_riscv.hpp line 298:
> 
>> 296:     }
>> 297: 
>> 298:     static int element_index(RVFeatureIndex feature) {
> 
> For consistency in naming, should we further rename this into something like `features_bitmap_element_index`?

Seems the too long name is not helpful, especially all the methods got the same prefix.
Maybe it's better to shorten all the names without the prefix, anyway they are all simple methods and private ones. How do you think about it?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27152#discussion_r2367109820
PR Review Comment: https://git.openjdk.org/jdk/pull/27152#discussion_r2367108257


More information about the hotspot-dev mailing list