RFR: 8331577: RISC-V: C2 CountLeadingZerosV [v3]

Fei Yang fyang at openjdk.org
Fri May 10 07:21:03 UTC 2024


On Fri, 10 May 2024 07:10:15 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Hi,
>> Can you help to review this patch adding CountLeadingZerosV and CountTrailingZerosV instrinsics?
>> Thanks.
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fix masked ReverseBytesV & PopCountV by sharing dst&src regs

src/hotspot/cpu/riscv/riscv_v.ad line 3766:

> 3764: instruct vreverse_bytes_masked(vReg dst_src, vRegMask_V0 v0) %{
> 3765:   match(Set dst_src (ReverseBytesV dst_src v0));
> 3766:   format %{ "vreverse_bytes_masked $dst_src, $dst_src, v0" %}

Nit: I think we can use something more accurate like `vrev8.v` as the opcode name in format. That will be consistent with the RVV spec. Also I suggest `v0.t` instead of `v0` or `$v0` as the mask for predicated instructs (Might deserve a separate PR for cleaning up other existing predicated instructs). Similar for other newly added instructs.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19153#discussion_r1596355741


More information about the hotspot-compiler-dev mailing list