RFR: 8310268: RISC-V: misaligned memory access in String.Compare intrinsic [v6]
Vladimir Kempik
vkempik at openjdk.org
Tue Jul 25 08:07:09 UTC 2023
On Tue, 25 Jul 2023 06:32:26 GMT, Fei Yang <fyang at openjdk.org> wrote:
>> Vladimir Kempik has updated the pull request incrementally with one additional commit since the last revision:
>>
>> remove unused branch
>
> src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 2364:
>
>> 2362: tmpU = isLU ? tmp5 : tmp1, // where to keep U for comparison
>> 2363: tmpL = isLU ? tmp1 : tmp5; // where to keep L for comparison
>> 2364:
>
> I see `cnt1`(x12) is unused now. We could make use of this to further eliminate use of both `tmp4` (x7) and `tmp5` (x31).
> Let:
>
> tmpU = isLU ? tmp2 : tmp1, // where to keep U for comparison
> tmpL = isLU ? tmp1 : tmp2; // where to keep L for comparison
>
> And use `cnt1` and `tmp2` instead where `tmp4` and `tmp5` are used respectively. This would help save one `mv` and saving & restoring of `tmp4` and `tmp5`. Also remember to change `tmpLval` from `tmp4` (x7) to `cnt1`(x12) in compare_string_8_x_LU.
It works, no difference in performance tho ( UL and LU cases)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14534#discussion_r1273154473
More information about the hotspot-dev
mailing list