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

Fei Yang fyang at openjdk.org
Mon Sep 15 08:47:13 UTC 2025


On Mon, 8 Sep 2025 19:54: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

Hi, I like the idea of separating the two group of flags. I am having a look.
BTW: Can you merge and rebase?

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

> 293:     }
> 294: 
> 295:     static int index(RVFeatureIndex feature) {

Seems better to rename this to `element_index`?

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

> 331:     }
> 332: 
> 333:     bool supports_feature(uint32_t feature) {

Should this be `support_feature` like its friends `set_feature` or `clear_feature` in style?

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

PR Review: https://git.openjdk.org/jdk/pull/27152#pullrequestreview-3223494725
PR Review Comment: https://git.openjdk.org/jdk/pull/27152#discussion_r2348274530
PR Review Comment: https://git.openjdk.org/jdk/pull/27152#discussion_r2348271850


More information about the hotspot-dev mailing list