RFR: 8321008: RISC-V: C2 MulAddVS2VI

Hamlin Li mli at openjdk.org
Mon Apr 29 13:34:04 UTC 2024


On Mon, 29 Apr 2024 13:24:29 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Hi,
>> Can you help to review the patch?
>> 
>> The motivation is to implement `MulAddVS2VI`.
>> But to enable `MulAddVS2VI`, `MulAddS2I` is prerequisite, although `MulAddS2I` does not bring extra benefit on riscv as we don't have an specific instruction of muladd on riscv.
>> So, this patch implement both `MulAddVS2VI` and `MulAddS2I`. 
>> 
>> Thanks
>
> src/hotspot/cpu/riscv/riscv_v.ad line 898:
> 
>> 896: 
>> 897:     __ vmul_vv(as_VectorRegister($dst$$reg), as_VectorRegister($dst$$reg), as_VectorRegister($tmp2$$reg));
>> 898:     __ vmacc_vv(as_VectorRegister($dst$$reg), as_VectorRegister($tmp1$$reg), as_VectorRegister($tmp3$$reg));
> 
> Hmm ... This doesn't look like a simple/straightforward sequence, isn't it? It's hard to tell whether we will benifit from this change without JMH testing on real RVV hardwares especially when VLEN is not large (At least no big difference in respect of number of instructions executed when VLEN=128-bits).

You're right.
I'm waiting for my board to test it. I'll update when I get the data.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18919#discussion_r1583096349


More information about the hotspot-compiler-dev mailing list