RFR: 8296515: RISC-V: Small refactoring for MaxReductionV/MinReductionV/AddReductionV node implementation [v2]

Yanhong Zhu yzhu at openjdk.org
Wed Nov 9 03:57:28 UTC 2022


On Tue, 8 Nov 2022 11:41:22 GMT, Gui Cao <gcao at openjdk.org> wrote:

>> HI,
>> 
>> The MaxReductionV, MinReductionV, AddReductionV nodes currently implemented by riscv rvv can be implemented by calling shared functions, and the T_BYTE and T_SHORT types in the MaxReductionV and MinReductionV node implementations can also be implemented in the same way as the T_INT type.
>> 
>> Please take a look and have some reviews. Thanks a lot.
>> 
>> ## Testing:
>> - hotspot and jdk tier1 on unmatched board without new failures
>> - test/jdk/jdk/incubator/vector/* with fastdebug on qemu
>
> Gui Cao has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Use the same predicate as reduce_addI
>  - Remove the REDUCTION_OP enumeration type and use Opcode to represent the operation

src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp line 1717:

> 1715:       vredxor_vs(tmp, src2, tmp);
> 1716:       break;
> 1717:     case Op_MaxReductionV:

We implemented Byte/Short MaxReductionV like this patch before. but there are 2 test cases that failed:
jdk/jdk/incubator/vector/ShortMaxVectorTests.java 
jdk/jdk/incubator/vector/ByteMaxVectorTests.java
The reason is that "make_reduction_input" will return INT_MAX for Byte & Short type.
Have you met this problem?

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

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


More information about the hotspot-dev mailing list