RFR: 8350095: RISC-V: Refactor string_compare [v5]
Hamlin Li
mli at openjdk.org
Tue Feb 25 11:16:59 UTC 2025
On Tue, 25 Feb 2025 02:47:49 GMT, Fei Yang <fyang at openjdk.org> wrote:
>> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
>>
>> clean 2
>
> src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp line 1480:
>
>> 1478: void C2_MacroAssembler::string_compare_long_different_encoding(Register result, Register str1, Register str2,
>> 1479: bool isLU, Register cnt1, Register cnt2,
>> 1480: Register tmpL, Register tmpU, Register tmp3,
>
> There is a naming inconsistency for the params. The prototype in the header file says `Register tmp1, Register tmp2, Register tmp3,`. I think we can still use that naming here and create aliases like `tmpL` and `tmpU` as needed in this routine. Like: `Register tmpL = tmp1; Register tmpU = tmp2;`
I'll modify the names in the header file, there is no need to introduce the renaming indirection.
> src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp line 1596:
>
>> 1594: // Load 4 bytes once to compare for alignment before main loop. Note that this
>> 1595: // is only possible for LL/UU case. We need to resort to load_long_misaligned
>> 1596: // for both LU and UL cases.
>
> This code comment needs to be moved to the proper place.
I'll just remove it, seems not necessary anymore.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23633#discussion_r1969559909
PR Review Comment: https://git.openjdk.org/jdk/pull/23633#discussion_r1969559808
More information about the hotspot-compiler-dev
mailing list