RFR: 8295261: RISC-V: Support ReductionV instructions for Vector API [v2]

Gui Cao gcao at openjdk.org
Fri Nov 4 15:56:10 UTC 2022


On Fri, 4 Nov 2022 09:03:12 GMT, Eric Liu <eliu at openjdk.org> wrote:

>> Gui Cao has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Move REDUCTION_OP definition to macroAssembler_riscv.hpp
>>  - Simplify part of the code, extract shared code
>
> src/hotspot/cpu/riscv/riscv_v.ad line 788:
> 
>> 786: 
>> 787: instruct reduce_andI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vReg tmp) %{
>> 788:   predicate(n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_INT);
> 
> Does `Matcher::vector_element_basic_type(n->in(2)) == T_INT` work here?

@theRealELiu Thank you for your suggestion, the current new nodes have been modified, and a new PR will be submitted in the future to modify other related places

> src/hotspot/cpu/riscv/riscv_v.ad line 838:
> 
>> 836:     __ vredor_vs(as_VectorRegister($tmp$$reg), as_VectorRegister($src2$$reg),
>> 837:                   as_VectorRegister($tmp$$reg));
>> 838:     __ vmv_x_s($dst$$Register, as_VectorRegister($tmp$$reg));
> 
> This is basically a shared code pattern for OrReductionV, AndReductionV, XorReduction.  Maybe a common method can help to simplify the code.

@theRealELiu Thanks, I extracted a portion of the shared code from it and made a new commit.

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

PR: https://git.openjdk.org/jdk/pull/10691


More information about the hotspot-compiler-dev mailing list