RFR: 8302908: RISC-V: Support masked vector arithmetic instructions for Vector API [v12]

Dingli Zhang dzhang at openjdk.org
Thu Apr 6 14:14:23 UTC 2023


On Thu, 6 Apr 2023 09:41:03 GMT, Pengfei Li <pli at openjdk.org> wrote:

>> Dingli Zhang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix comment
>
> src/hotspot/cpu/riscv/riscv.ad line 1936:
> 
>> 1934:     case Op_XorVMask:
>> 1935:     case Op_OrVMask:
>> 1936:       return true;
> 
> I'm not quite familiar with RISC-V but my perception is that, for any `opcode, vlen, bt` combination, if the non-masked support check `Matcher::match_rule_supported_vector()` returns false, this masked version should return false as well. So I suggest calling `Matcher::match_rule_supported_vector()` instead of directly returning true here. You may refer the code in `aarch64_vector.ad`.

Thanks for the review! Fixed.

> src/hotspot/cpu/riscv/riscv_v.ad line 348:
> 
>> 346: // vector add - predicated
>> 347: 
>> 348: instruct vadd_masked(vReg dst_src1, vReg src2, vRegMask_V0 vmask) %{
> 
> Should this be named "vaddB_masked"?

Fixed.

> src/hotspot/cpu/riscv/riscv_v.ad line 501:
> 
>> 499: // vector float div - predicated
>> 500: 
>> 501: instruct vdivF_masked(vReg dst_src1, vReg src2, vRegMask_V0 vmask) %{
> 
> Perhaps adding a predicate of UseRVV, for all these matching rules?

There are two cases of vector nodes in aarch64, `neon` and `sve`, but there doesn't seem to be two cases in riscv. `match_rule_supported_vector -> op_vec_supported` affects whether to generate a vector c2 node, where the default return value is `UseRVV` except for false.
So I think even if the vector c2 node in riscv is a composite node (e.g. `vdivF_masked`), maybe there is no need to add the predicate `UseRVV` to each matching rule.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/12682#discussion_r1159853171
PR Review Comment: https://git.openjdk.org/jdk/pull/12682#discussion_r1159853422
PR Review Comment: https://git.openjdk.org/jdk/pull/12682#discussion_r1159854187


More information about the hotspot-compiler-dev mailing list