RFR: 8309502: RISC-V: String.indexOf intrinsic may produce misaligned memory loads [v4]
Andrew Haley
aph at openjdk.org
Thu Jun 8 20:48:42 UTC 2023
On Thu, 8 Jun 2023 12:19:36 GMT, Vladimir Kempik <vkempik at openjdk.org> wrote:
> > I am very concerned about the increased complexity and maintenance burden caused by these unaligned access patches. While RISC-V is not a mainstream arch at this time, it may become one, and it that happens we'll need something reasonably maintainable. Sprinkling '`if (AvoidUnalignedAccesses)`' all over the back end is disastrous for readability. I urge you to find a more abstract solution, for example by creating a memory access assembler class and subclassing it as appropriate with aligned and unaligned versions.
>
> Hello, do you mean things like load_XXXX_misaligned ( e.g. https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp#L1735 ) or more complicated things ?
That's certainly a good start, although I believe its implementation could be much improved. But everywhere you see `if (AvoidUnalignedAccesses)` is potentially a candidate for factoring out the parts and moving them into a misaligned memory access class.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14320#issuecomment-1583318757
More information about the hotspot-compiler-dev
mailing list