RFR: 8296515: RISC-V: Optimized MaxReductionV/MinReductionV/AddReductionV node implementation [v2]

Gui Cao gcao at openjdk.org
Tue Nov 8 11:47:19 UTC 2022


On Tue, 8 Nov 2022 09:36:07 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:

> Given the predicate `Matcher::vector_element_basic_type(n->in(2)) != T_LONG`, is there a risk it's going to match for types that don't fit the assert at https://github.com/openjdk/jdk/pull/11036/files#diff-35eb1d2f1e2f0514dd46bd7fbad49ff2c87703d5a3041a6433956df00a3fe6e6R1696 ?
> 
> It seems the same approach as `reduce_addI` should be taken with the following predicate:
> 
> ```
>   predicate(Matcher::vector_element_basic_type(n->in(2)) == T_BYTE || 
>             Matcher::vector_element_basic_type(n->in(2)) == T_SHORT ||
>             Matcher::vector_element_basic_type(n->in(2)) == T_INT);
> ```

Thanks. referring to aarch64 before, for unnecessary risks, now the same predicate is used as reduce_addI.

> src/hotspot/cpu/riscv/riscv_v.ad line 855:
> 
>> 853:   ins_encode %{
>> 854:     BasicType bt = Matcher::vector_element_basic_type(this, $src2);
>> 855:     __ rvv_reduce_integral($dst$$Register, as_VectorRegister($tmp$$reg),
> 
> Same as https://github.com/openjdk/jdk/pull/11036#discussion_r1016358443

> Same as [#11036 (comment)](https://github.com/openjdk/jdk/pull/11036#discussion_r1016358443)

Thanks, fixed.

> src/hotspot/cpu/riscv/riscv_v.ad line 889:
> 
>> 887:   ins_encode %{
>> 888:     BasicType bt = Matcher::vector_element_basic_type(this, $src2);
>> 889:     __ rvv_reduce_integral($dst$$Register, as_VectorRegister($tmp$$reg),
> 
> Same as https://github.com/openjdk/jdk/pull/11036#discussion_r1016358443

> Same as [#11036 (comment)](https://github.com/openjdk/jdk/pull/11036#discussion_r1016358443)

Thanks, fixed.

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

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


More information about the hotspot-dev mailing list