RFR: 8315716: RISC-V: implement ChaCha20 intrinsic
Ludovic Henry
luhenry at openjdk.org
Wed Sep 27 10:09:44 UTC 2023
On Tue, 26 Sep 2023 17:43:15 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 4342:
>>
>>> 4340: // Put 16 here, as com.sun.crypto.providerChaCha20Cipher.KS_MAX_LEN is 1024
>>> 4341: // in java level.
>>> 4342: __ li(avl, 16);
>>
>> It's recommended to use `__ mv(avl, 16);` to copy a constant to a register.
>
> Is there a difference between mv and li? Seems that mv(...) is calling li(...)?
>
> template<typename T, ENABLE_IF(std::is_integral<T>::value)>
> inline void mv(Register Rd, T o) { li(Rd, (int64_t)o); }
>
> Or the recommendation is a code convention?
It's only code convention in Hotspot.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15899#discussion_r1338340087
More information about the hotspot-dev
mailing list