RFR: 8307609: RISC-V: Added support for Extract, Compress, Expand and other nodes for Vector API [v2]

Dingli Zhang dzhang at openjdk.org
Mon May 15 07:10:03 UTC 2023


On Mon, 15 May 2023 01:50:57 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Dingli Zhang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 10 commits:
>> 
>>  - Merge master and resolve conflict
>>  - Optimize call point of vfclass and adjust the parameters of c2 instruct
>>  - Remove VectorTest
>>  - Merge remote-tracking branch 'upstream/master' into JDK-8307609
>>  - Optimize vmask_gen_imm
>>  - Add VectorTest
>>  - FFix some vsetvli_helper location
>>  - Remove useless INSN and simplify gather load
>>  - Refactor match_rule_supported_vector
>>  - 8307609: RISC-V: Added support for Extract, Compress, Expand and other nodes for Vector API
>
> src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp line 1635:
> 
>> 1633: 
>> 1634: // Set dst to NaN if any NaN input.
>> 1635: void C2_MacroAssembler::minmax_fp_masked_v(VectorRegister dst_src1, VectorRegister src2,
> 
> Better to break down `dst_src1` into two seperate operands, i.e., `dst` and `src1`.

Fixed.

> src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp line 1644:
> 
>> 1642:   // Check vector elements of src1 and src2 for quiet and signaling NaN.
>> 1643:   vfclass_v(tmp1, dst_src1);
>> 1644:   vfclass_v(tmp2, src2);
> 
> As discussed offline, a better way for finding NaN from the vector elements is with `vmfne` instruction, like: `vmfeq.vv v0, va, va`. vmfne writes 1 to the destination element when the corresponding element of `va` is NaN.

Fixed.

> src/hotspot/cpu/riscv/riscv_v.ad line 4134:
> 
>> 4132:     __ vsetvli_helper(bt, Matcher::vector_length(this));
>> 4133:     __ vid_v(as_VectorRegister($v0$$reg));
>> 4134:     __ mv($tmp1$$Register, (int)($idx$$constant));
> 
> Suggestion: make `idx` an register input operand and eliminate this `mv` instruction and maybe the `tmp1` register reserved.

Thanks for the review! Fixed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13862#discussion_r1193407301
PR Review Comment: https://git.openjdk.org/jdk/pull/13862#discussion_r1193407402
PR Review Comment: https://git.openjdk.org/jdk/pull/13862#discussion_r1193407151


More information about the hotspot-compiler-dev mailing list