RFR: 8368950: RISC-V: fail to catch out of order declarations among dependent cpu extensions/flags [v2]
Hamlin Li
mli at openjdk.org
Tue Oct 14 10:09:44 UTC 2025
On Tue, 14 Oct 2025 09:45:47 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> src/hotspot/cpu/riscv/vm_version_riscv.hpp line 73:
>>
>>> 71: // For non-ext flags, they don't have dependency relationship among each other,
>>> 72: // in this situation, just return the default value -1.
>>> 73: virtual int dependent_index() { return -1; }
>>
>> I wonder if we can make this feature index a bit more general. Currently, we only have `_cpu_feature_index` for subclass RVExtFeatureValue. But I think extensions and non-extensions could both have their own feature index for their group respectively. So maybe we can add a `_feature_index` member here for this base class and a `feature_index()` method, which seems cleaner to me.
>
> I see what you mean.
> I have a another idea. As these dependency checks are only used in extension related scenarios (ie. RVExtFeatureValue), how about we move all these things into RVExtFeatureValue, including `dependent_index`, `deps_all_enabled`, `deps_string` and `verify_deps`?
please have a look at the second commit, currently only RVExtFeatureValue needs a (cpu) feature index and depenecny checks, so seems it's better to keep it inside RVExtFeatureValue. let me know how you think about it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27572#discussion_r2428610145
More information about the hotspot-dev
mailing list