RFR: 8320999: RISC-V: C2 RotateLeftV [v2]

Fei Yang fyang at openjdk.org
Fri May 24 14:51:01 UTC 2024


On Fri, 24 May 2024 13:15:37 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Yeah. If that is the case, maybe we can save one vector register then? 
>> I mean let `instruct vrotate_right_reg(vReg dst, vReg src, Reg shift)` match something like this:
>> `match(Set dst (RotateRightV src (Replicate shift)))`.
>
> Not sure, could be. If this is the case, then the vecotr shift should be optimized too?
> 
> I check the code generated, seems we're fine?
> 
>   0x00002aaac560c55a:   vmv.v.x v1,a3
>   ... ...
>   0x00002aaac560c594:   vle32.v v2,(a4)
>   0x00002aaac560c598:   vsetivli        t0,8,e32,m1,tu,mu
>   0x00002aaac560c59c:   vror.vv v2,v2,v1
> 
> 
> In any way, we need 2 v register's?

Yes, I think there should be quite a few places where we could make use of vector-scalar variants, which would save us one vector register. @zifeihan has already handle some cases in vector logic instructions: https://github.com/openjdk/jdk/pull/18999. And He is currently working on handling more vector arithmetic instructions.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19325#discussion_r1613602729


More information about the hotspot-compiler-dev mailing list