RFR: 8318217: RISC-V: C2 VectorizedHashCode [v10]

Yuri Gaevsky duke at openjdk.org
Sun Dec 10 12:14:37 UTC 2023


On Sun, 10 Dec 2023 11:16:09 GMT, Yuri Gaevsky <duke at openjdk.org> wrote:

>> Yes, I know what you mean. And that's also what I am suggesting in my initial comment: move this `beqz` check immediately after the loop (that is after L1522 in your latest version). Like following add-on change:
>> 
>> 
>> diff --git a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
>> index 2d93d36a37f..11cbcaa48a1 100644
>> --- a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
>> +++ b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
>> @@ -1521,9 +1521,9 @@ void C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register res
>>                                   //           + 31^^1 * ary[i+2] + 31^^0 * ary[i+3]
>>    addi(ary, ary, elsize * stride);
>>    bne(ary, chunks_end, WIDE_LOOP);
>> +  beqz(cnt, DONE);
>> 
>>    bind(TAIL);
>> -  beqz(cnt, DONE);
>>    slli(chunks_end, cnt, chunks_end_shift);
>>    add(chunks_end, ary, chunks_end);
>
> Ah, got it finally. Nice catch, thanks!

Fixed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16629#discussion_r1421738968


More information about the hotspot-dev mailing list