RFR: 8356875: RISC-V: extension flag UseZvfh should depends on UseZfh

Hamlin Li mli at openjdk.org
Wed May 14 08:48:52 UTC 2025


On Wed, 14 May 2025 01:06:15 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Hi,
>> Can you help to review this simple patch?
>> If we don't enable such dependency, then there will be situation that when Zvfh is enabled but Zfh is disabled, and optimizations depending on Zvfh will be disabled (e.g. in C2) because Zfh related IR node are considered not supported.
>> 
>> Thanks!
>> 
>> By [rvv spec](https://github.com/riscvarchive/riscv-v-spec/blob/master/v-spec.adoc#185-zvfh-vector-extension-for-half-precision-floating-point), `The Zvfh extension depends on the Zve32f and Zfhmin extensions.`
>> But I think in logic and JVM code, we should let `Zvfh` depends on `Zfh`.
>
> src/hotspot/cpu/riscv/vm_version_riscv.cpp line 251:
> 
>> 249:       warning("Cannot enable UseZvfh on cpu without Zfh support.");
>> 250:       FLAG_SET_DEFAULT(UseZvfh, false);
>> 251:     }
> 
> For QEMU, Zvfh also means Zvfhmin and Zfhmin. So there is no Zfh if you only enable Zvfh when start QEMU.
> That means hwprobe syscall will detect Zvfh and Zfhmin but no Zfh. Is there a similar issue for this case?

One question: Not sure if I understand you correctly, seems to me Zfh is also detected and automatically set by hwprobe when running with qemu?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25213#discussion_r2088413185


More information about the hotspot-dev mailing list