Skip to content

Commit

Permalink
8297238: RISC-V: C2: Use Matcher::vector_element_basic_type when chec…
Browse files Browse the repository at this point in the history
…king for vector element type in predicate

Reviewed-by: dzhang, fyang
  • Loading branch information
zifeihan authored and RealFYang committed Nov 21, 2022
1 parent 891c706 commit e420661
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/hotspot/cpu/riscv/riscv_v.ad
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ instruct vdivD(vReg dst, vReg src1, vReg src2) %{
// vector integer max/min

instruct vmax(vReg dst, vReg src1, vReg src2) %{
predicate(n->bottom_type()->is_vect()->element_basic_type() != T_FLOAT &&
n->bottom_type()->is_vect()->element_basic_type() != T_DOUBLE);
predicate(Matcher::vector_element_basic_type(n) != T_FLOAT &&
Matcher::vector_element_basic_type(n) != T_DOUBLE);
match(Set dst (MaxV src1 src2));
ins_cost(VEC_COST);
format %{ "vmax.vv $dst, $src1, $src2\t#@vmax" %}
Expand All @@ -375,8 +375,8 @@ instruct vmax(vReg dst, vReg src1, vReg src2) %{
%}

instruct vmin(vReg dst, vReg src1, vReg src2) %{
predicate(n->bottom_type()->is_vect()->element_basic_type() != T_FLOAT &&
n->bottom_type()->is_vect()->element_basic_type() != T_DOUBLE);
predicate(Matcher::vector_element_basic_type(n) != T_FLOAT &&
Matcher::vector_element_basic_type(n) != T_DOUBLE);
match(Set dst (MinV src1 src2));
ins_cost(VEC_COST);
format %{ "vmin.vv $dst, $src1, $src2\t#@vmin" %}
Expand All @@ -393,7 +393,7 @@ instruct vmin(vReg dst, vReg src1, vReg src2) %{
// vector float-point max/min

instruct vmaxF(vReg dst, vReg src1, vReg src2) %{
predicate(n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
predicate(Matcher::vector_element_basic_type(n) == T_FLOAT);
match(Set dst (MaxV src1 src2));
effect(TEMP_DEF dst);
ins_cost(VEC_COST);
Expand All @@ -407,7 +407,7 @@ instruct vmaxF(vReg dst, vReg src1, vReg src2) %{
%}

instruct vmaxD(vReg dst, vReg src1, vReg src2) %{
predicate(n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
predicate(Matcher::vector_element_basic_type(n) == T_DOUBLE);
match(Set dst (MaxV src1 src2));
effect(TEMP_DEF dst);
ins_cost(VEC_COST);
Expand All @@ -421,7 +421,7 @@ instruct vmaxD(vReg dst, vReg src1, vReg src2) %{
%}

instruct vminF(vReg dst, vReg src1, vReg src2) %{
predicate(n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
predicate(Matcher::vector_element_basic_type(n) == T_FLOAT);
match(Set dst (MinV src1 src2));
effect(TEMP_DEF dst);
ins_cost(VEC_COST);
Expand All @@ -435,7 +435,7 @@ instruct vminF(vReg dst, vReg src1, vReg src2) %{
%}

instruct vminD(vReg dst, vReg src1, vReg src2) %{
predicate(n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
predicate(Matcher::vector_element_basic_type(n) == T_DOUBLE);
match(Set dst (MinV src1 src2));
effect(TEMP_DEF dst);
ins_cost(VEC_COST);
Expand Down Expand Up @@ -1053,7 +1053,7 @@ instruct vreduce_minL(iRegLNoSp dst, iRegL src1, vReg src2, vReg tmp) %{
// vector float max reduction

instruct vreduce_maxF(fRegF dst, fRegF src1, vReg src2, vReg tmp1, vReg tmp2) %{
predicate(n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
predicate(Matcher::vector_element_basic_type(n->in(2)) == T_FLOAT);
match(Set dst (MaxReductionV src1 src2));
ins_cost(VEC_COST);
effect(TEMP_DEF dst, TEMP tmp1, TEMP tmp2);
Expand All @@ -1068,7 +1068,7 @@ instruct vreduce_maxF(fRegF dst, fRegF src1, vReg src2, vReg tmp1, vReg tmp2) %{
%}

instruct vreduce_maxD(fRegD dst, fRegD src1, vReg src2, vReg tmp1, vReg tmp2) %{
predicate(n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
predicate(Matcher::vector_element_basic_type(n->in(2)) == T_DOUBLE);
match(Set dst (MaxReductionV src1 src2));
ins_cost(VEC_COST);
effect(TEMP_DEF dst, TEMP tmp1, TEMP tmp2);
Expand All @@ -1085,7 +1085,7 @@ instruct vreduce_maxD(fRegD dst, fRegD src1, vReg src2, vReg tmp1, vReg tmp2) %{
// vector float min reduction

instruct vreduce_minF(fRegF dst, fRegF src1, vReg src2, vReg tmp1, vReg tmp2) %{
predicate(n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
predicate(Matcher::vector_element_basic_type(n->in(2)) == T_FLOAT);
match(Set dst (MinReductionV src1 src2));
ins_cost(VEC_COST);
effect(TEMP_DEF dst, TEMP tmp1, TEMP tmp2);
Expand All @@ -1100,7 +1100,7 @@ instruct vreduce_minF(fRegF dst, fRegF src1, vReg src2, vReg tmp1, vReg tmp2) %{
%}

instruct vreduce_minD(fRegD dst, fRegD src1, vReg src2, vReg tmp1, vReg tmp2) %{
predicate(n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
predicate(Matcher::vector_element_basic_type(n->in(2)) == T_DOUBLE);
match(Set dst (MinReductionV src1 src2));
ins_cost(VEC_COST);
effect(TEMP_DEF dst, TEMP tmp1, TEMP tmp2);
Expand All @@ -1117,7 +1117,7 @@ instruct vreduce_minD(fRegD dst, fRegD src1, vReg src2, vReg tmp1, vReg tmp2) %{
// vector Math.rint, floor, ceil

instruct vroundD(vReg dst, vReg src, immI rmode) %{
predicate(n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
predicate(Matcher::vector_element_basic_type(n) == T_DOUBLE);
match(Set dst (RoundDoubleModeV src rmode));
format %{ "vroundD $dst, $src, $rmode" %}
ins_encode %{
Expand Down Expand Up @@ -1672,7 +1672,7 @@ instruct vlslL_imm(vReg dst, vReg src, immI shift) %{
%}

instruct vshiftcntB(vReg dst, iRegIorL2I cnt) %{
predicate(n->bottom_type()->is_vect()->element_basic_type() == T_BYTE);
predicate(Matcher::vector_element_basic_type(n) == T_BYTE);
match(Set dst (LShiftCntV cnt));
match(Set dst (RShiftCntV cnt));
format %{ "vmv.v.x $dst, $cnt\t#@vshiftcntB" %}
Expand All @@ -1684,8 +1684,8 @@ instruct vshiftcntB(vReg dst, iRegIorL2I cnt) %{
%}

instruct vshiftcntS(vReg dst, iRegIorL2I cnt) %{
predicate(n->bottom_type()->is_vect()->element_basic_type() == T_SHORT ||
n->bottom_type()->is_vect()->element_basic_type() == T_CHAR);
predicate(Matcher::vector_element_basic_type(n) == T_SHORT ||
Matcher::vector_element_basic_type(n) == T_CHAR);
match(Set dst (LShiftCntV cnt));
match(Set dst (RShiftCntV cnt));
format %{ "vmv.v.x $dst, $cnt\t#@vshiftcntS" %}
Expand All @@ -1697,7 +1697,7 @@ instruct vshiftcntS(vReg dst, iRegIorL2I cnt) %{
%}

instruct vshiftcntI(vReg dst, iRegIorL2I cnt) %{
predicate(n->bottom_type()->is_vect()->element_basic_type() == T_INT);
predicate(Matcher::vector_element_basic_type(n) == T_INT);
match(Set dst (LShiftCntV cnt));
match(Set dst (RShiftCntV cnt));
format %{ "vmv.v.x $dst, $cnt\t#@vshiftcntI" %}
Expand All @@ -1709,7 +1709,7 @@ instruct vshiftcntI(vReg dst, iRegIorL2I cnt) %{
%}

instruct vshiftcntL(vReg dst, iRegIorL2I cnt) %{
predicate(n->bottom_type()->is_vect()->element_basic_type() == T_LONG);
predicate(Matcher::vector_element_basic_type(n) == T_LONG);
match(Set dst (LShiftCntV cnt));
match(Set dst (RShiftCntV cnt));
format %{ "vmv.v.x $dst, $cnt\t#@vshiftcntL" %}
Expand Down

1 comment on commit e420661

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.