RFR: 8368897: RISC-V: Cleanup RV_EXT_FEATURE_FLAGS & RV_NON_EXT_FEATURE_FLAGS [v4]
Hamlin Li
mli at openjdk.org
Tue Oct 7 08:16:28 UTC 2025
On Tue, 7 Oct 2025 06:24:21 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
>> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 5877:
>>
>>> 5875: // you want to use it elsewhere, note that cnt must be >= zicboz_block_size.
>>> 5876: void MacroAssembler::zero_dcache_blocks(Register base, Register cnt, Register tmp1, Register tmp2) {
>>> 5877: int zicboz_block_size = VM_Version::non_ext_ZicbozBlockSize.value();
>>
>> Hi, I am a bit concerned that the names might be too long. Say you have something like `VM_Version::non_ext_zicboz_block_size`.
>> How about introducing some extra namespaces if we want to distinguish these two groups (extensions and non-extensions)?
>> Then we could have something like `VM_Version::non_ext::zicboz_block_size`, `VM_Version::ext::rvi`, `VM_Version::ext::rvm`. What do you think?
>
> Yes, maybe.
>
> I just don't understand why vector length is something different than zicboz block size.
> E.g.
>
> CacheLineSize // gets cache-line size
> VM_Version::ext::zic64b(); // gets 64b cache-line size
> VM_Version::non_ext::zicboz_block_size(); // gets cache block size
> VM_Version::cpu_vector_length(); // private, gets vector register length (HW), should be size not length IMHO
> MaxVectorSize // gets vector register length (-+ cmd-line)
>
>
> When I am actually using these value in MASM/stubs/instrinsic/etc.. I don't care where this value came from.
> If it's command line or RVI extension or if we with some other mean figured this setting out.
>
> I think it would be nice to try to get a consistent API in VM_Version.
> But I don't think that is possible (due to global flags), but I think we can at least do something better here, no?
>
> As it is now it really hard to review as I need to double check if the correct setting was used.
Maybe just keep the original names, and use them as pretty too? The code looks like `VM_Version::non_ext::zicboz_block_size()`, and the printed feature "pretty" name would be "zicboz_block_size".
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27562#discussion_r2409791358
More information about the hotspot-dev
mailing list