RFR: 8333245: RISC-V: UseRVV option can't be enabled after JDK-8316859
Ludovic Henry
luhenry at openjdk.org
Thu Jun 27 10:07:17 UTC 2024
On Thu, 30 May 2024 09:13:30 GMT, Gui Cao <gcao at openjdk.org> wrote:
> Because some dev boards only support RVV version 0.7, In [JDK-8316859](https://bugs.openjdk.org/browse/JDK-8316859) we masked the use of HWCAP to probe for RVV extensions, and in the meantime, we can use hwprobe to probe for V extensions in Linux kernel 6.5 and above. But recently we got Banana Pi BPI-F3 board (has RVV1.0), but his kernel is 6.1.15, so the V extensions detected by HWCAP are masked. And we get the warning: `RVV is not supported on this CPU` when we enable UseRVV with the command, and we can't enable UseRVV correctly.
>
> Without Patch:
>
> zifeihan at bananapif3:~/jre/jdk/bin$ ./java -XX:+PrintFlagsFinal -XX:+UseRVV -version | grep UseRVV
> OpenJDK 64-Bit Server VM warning: RVV is not supported on this CPU
> bool UseRVV = false {ARCH product} {command line}
> bool UseRVVForBigIntegerShiftIntrinsics = false {ARCH product} {default}
> openjdk version "23-internal" 2024-09-17
> OpenJDK Runtime Environment (build 23-internal-adhoc.zifeihan.jdk)
> OpenJDK 64-Bit Server VM (build 23-internal-adhoc.zifeihan.jdk, mixed mode)
>
>
> With Patch:
>
> zifeihan at bananapif3:~/jre/jdk/bin$ ./java -XX:+PrintFlagsFinal -XX:+UseRVV -version | grep UseRVV
> bool UseRVV = true {ARCH product} {command line}
> bool UseRVVForBigIntegerShiftIntrinsics = true {ARCH product} {default}
> openjdk version "23-internal" 2024-09-17
> OpenJDK Runtime Environment (build 23-internal-adhoc.zifeihan.jdk)
> OpenJDK 64-Bit Server VM (build 23-internal-adhoc.zifeihan.jdk, mixed mode)
We need to update our check from hwcap with something along the line of:
vsetvli t0, zero, e8, m1, ta, ma
csrr a0, vtype
sgtz a0, a0
ret
That will return whether v1.0 is supported since `vsetvli t0, zero, e8, m1, ta, ma` will set the `vill` flag on RVV 0.7.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19472#issuecomment-2194290073
More information about the hotspot-dev
mailing list