RFR: 8368732: RISC-V: Detect support for misaligned vector access via hwprobe [v7]
Fei Yang
fyang at openjdk.org
Tue Sep 30 01:16:42 UTC 2025
> Hi, this is a followup change after [JDK-8368366](https://bugs.openjdk.org/browse/JDK-8368366).
>
> According to the latest RISC-V linux hardware probing syscall [1], the performance of misaligned memory accesses has been divided into two cases: `RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF` and `RISCV_HWPROBE_KEY_MISALIGNED_VECTOR_PERF` for scalar and vector respectively.
>
> This aligns `AlignVector` with `RISCV_HWPROBE_KEY_MISALIGNED_VECTOR_PERF`. That is if the misaligned vector access is fast, we set `AlignVector` to false in the hope that it will save instructions handling address alignment thus improves performance.
>
> This choose to keep the use of `RISCV_HWPROBE_KEY_CPUPERF_0` which is now deprecated and returns similar values
> to `RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF` for backward compatibility with old linux kernels.
>
> Manually checked the result on platforms w/wo fast misaligned vector accesses by running:
> `$java -XX:+PrintFlagsFinal -version | grep AlignVector`
>
> [1] https://docs.kernel.org/arch/riscv/hwprobe.html
Fei Yang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
- Merge remote-tracking branch 'upstream/master' into JDK-8368732
- Review
- Review
- Fix
- Macro names
- More white spaces
- White spaces
- 8368732: RISC-V: Detect support for misaligned vector access via hwprobe
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27512/files
- new: https://git.openjdk.org/jdk/pull/27512/files/aabf1ea9..4d6540a8
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27512&range=06
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27512&range=05-06
Stats: 3556 lines in 121 files changed: 2187 ins; 661 del; 708 mod
Patch: https://git.openjdk.org/jdk/pull/27512.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27512/head:pull/27512
PR: https://git.openjdk.org/jdk/pull/27512
More information about the hotspot-dev
mailing list