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

Ludovic Henry luhenry at openjdk.org
Wed Sep 24 15:33:53 UTC 2025


On Wed, 24 Sep 2025 13:29:41 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Hi,
>> Can you help to review this patch?
>> 
>> Currently, the cpu features of riscv are stored in separate RVFeature subclasses.
>> But to support the store/restore CPU features for aot in the future, we need to store the cpu features in a continuous memory.
>> As the riscv extensions are introduced continuously, I think it's better to do it via an simple bitmap at the beginning.
>> Currently, just suppose the non-extension features will not be stored in aot image, so I also split the extension and non-extenion features. When we implement the related aot feature in the short future, we can revisit the way of splitting the features. Currently, just change the storage way of cpu features, lay the foundation for future aot.
>> 
>> Thanks
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove explicit cpu feature index in RV_EXT_FEATURE_FLAGS

LGTM!

src/hotspot/cpu/riscv/vm_version_riscv.hpp line 248:

> 246:   static NAME##RVExtFeatureValue NAME;                                                  \
> 247: 
> 248:   RV_EXT_FEATURE_FLAGS(DECLARE_RV_EXT_FEATURE)

Maybe an `#undef DECLARE_RV_EXT_FEATURE` after that line?

src/hotspot/cpu/riscv/vm_version_riscv.hpp line 268:

> 266:   static NAME##RVNonExtFeatureValue NAME;                                          \
> 267: 
> 268:   RV_NON_EXT_FEATURE_FLAGS(DECLARE_RV_NON_EXT_FEATURE)

It would be good to `#undef DECLARE_RV_NON_EXT_FEATURE` right after that.

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

Marked as reviewed by luhenry (Committer).

PR Review: https://git.openjdk.org/jdk/pull/27152#pullrequestreview-3263473326
PR Review Comment: https://git.openjdk.org/jdk/pull/27152#discussion_r2376188713
PR Review Comment: https://git.openjdk.org/jdk/pull/27152#discussion_r2376191865


More information about the hotspot-dev mailing list