RFR: 8322179: RISC-V: Implement SHA-1 intrinsic [v10]
Fei Yang
fyang at openjdk.org
Fri Feb 23 10:55:00 UTC 2024
On Wed, 21 Feb 2024 16:05:10 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 4953:
>>
>>> 4951: __ rolw_imm(cur_w, a, 5, t0);
>>> 4952: // as pointed above, we can use cur_w as temporary register here.
>>> 4953: sha1_f(round, tmp, b, c, d);
>>
>> Could we also reuse `cur_k` in this function where input param `tmp` is used? I see `cur_k` will also be recalculated at the beginning of each round like `cur_w`. Hope this could help eliminate `tmp` param and finally free `t2`.
>
> Seems not, as cur_k is only calculated when `(round % 20) == 0`.
>
> Other comments are all resolved.
Thanks. Could you please move `int round` as the last formal param for other assembler functions so that it will be more consistent? They are `sha1_prepare_w`, `sha1_f`, and `sha1_process_round`. BTW: I think it will be safer to add scratch register `t0`, `t1` to the list for `assert_different_registers` if they are used in those assembler functions.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17130#discussion_r1500497514
More information about the hotspot-dev
mailing list