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

Hamlin Li mli at openjdk.org
Wed Nov 15 17:16:35 UTC 2023


On Wed, 15 Nov 2023 15:51:50 GMT, Yuri Gaevsky <duke at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp line 1527:
>> 
>>> 1525:   addw(result, result, tmp3);      // 31^^4 * h + 31^^3 * ary[i+0] + 31^^2 * ary[i+1]
>>> 1526:                                    //           + 31^^1 * ary[i+2] + 31^^0 * ary[i+3]
>>> 1527:   subw(chunk, chunk, stride);
>> 
>> Could chunk and ary be merged into one variable? so we don't need one sub and one add, but only one add here.
>
> Could you please clarify? I don't understand how that's possible.

chunk is only used to tell if the wide loop is done, which can be done by ary too.

And as subw of chunk and addi of ary is in a loop which could be a long one, so better to reduce the instructions in the loop.

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

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


More information about the hotspot-dev mailing list