RFR: 8320999: RISC-V: C2 RotateLeftV [v2]
Fei Yang
fyang at openjdk.org
Fri May 24 15:00:03 UTC 2024
On Fri, 24 May 2024 14:53:15 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:
>> 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 and one vmv.v.x instruction. @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.
>>
>> (One example: https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/riscv_v.ad#L523)
>
> I would also favor using `.vi` or `.vx` variants over `.vv` variants where possible. This would reduce the vector register pressure and remove an unnecessary instruction.
>
> @Hamlin-Li in your example, we could instead have:
>
> ... ...
> 0x00002aaac560c594: vle32.v v2,(a4)
> 0x00002aaac560c598: vsetivli t0,8,e32,m1,tu,mu
> 0x00002aaac560c59c: vror.vx v2,v2,a3
And for your case, this would help save the `vmv.v.x v1,a3` instruction if you do `vror.vv v2,v2,a3` instead of `vror.vv v2,v2,v1`. Right?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19325#discussion_r1613614979
More information about the hotspot-compiler-dev
mailing list