RFR: 8334554: RISC-V: verify & fix perf of string comparison

Fei Yang fyang at openjdk.org
Tue Jun 25 11:55:12 UTC 2024


On Tue, 25 Jun 2024 11:48:57 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> By https://github.com/openjdk/jdk/pull/18382#discussion_r1645356197, do you mean current lastest implementation of it still brings negative impact on performance after https://github.com/openjdk/jdk/pull/18382/commits/1d4320b205c173256eb6a50cedaa0ccd9b4122d8?
>
> I just tried m1 like following change, it only brings negative impact on banana-pi. So ignore my previous comment.
> 
> diff --git a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
> index 9ce197a44bf..24ebc1fbe54 100644
> --- a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
> +++ b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
> @@ -2331,7 +2331,7 @@ void C2_MacroAssembler::element_compare(Register a1, Register a2, Register resul
>    Assembler::SEW sew = islatin ? Assembler::e8 : Assembler::e16;
> 
>    bind(loop);
> -  vsetvli(tmp1, cnt, sew, Assembler::m2);
> +  vsetvli(tmp1, cnt, sew, Assembler::m1);
>    vlex_v(vr1, a1, sew);
>    vlex_v(vr2, a2, sew);
>    vmsne_vv(vrs, vr1, vr2);

> By [#18382 (comment)](https://github.com/openjdk/jdk/pull/18382#discussion_r1645356197), do you mean current lastest implementation of it still brings negative impact on performance after [1d4320b](https://github.com/openjdk/jdk/commit/1d4320b205c173256eb6a50cedaa0ccd9b4122d8)?

Yes.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19825#discussion_r1652661418


More information about the hotspot-compiler-dev mailing list