RFR: 8317721: RISC-V: Implement CRC32 intrinsic [v13]

Fei Yang fyang at openjdk.org
Wed Jul 3 11:57:26 UTC 2024


On Wed, 3 Jul 2024 10:23:44 GMT, ArsenyBochkarev <duke at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 1345:
>> 
>>> 1343:   lwu(tmp2, Address(tmp3));
>>> 1344:   if (upper) {
>>> 1345:     tmp1 = v;
>> 
>> Why bother letting `tmp1` alias `v` here?
>
> Whoops, looks like it is a leftover from [this](https://github.com/openjdk/jdk/pull/17046/commits/654b25b7e5a0fa17eedbdaf3a3de66ba53c28420) commit, and I missed it. I don't think it costs performance much, and it is functionally correct, but it truly is an unnecessary alias (the `compiler/intrinsics/zip/TestCRC32.java` is ok without it)

Better to remove it as it might confuse people making the code hard to understand. And it deserve a code comment for this if-else as it doesn't look obvious about the difference between using `srli` and `srliw` here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17046#discussion_r1664069691


More information about the hotspot-compiler-dev mailing list