@@ -63,9 +63,6 @@ source %{
63
63
case Op_ExtractS:
64
64
case Op_ExtractUB:
65
65
// Vector API specific
66
- case Op_AndReductionV:
67
- case Op_OrReductionV:
68
- case Op_XorReductionV:
69
66
case Op_LoadVectorGather:
70
67
case Op_StoreVectorScatter:
71
68
case Op_VectorBlend:
@@ -809,6 +806,108 @@ instruct vnegD(vReg dst, vReg src) %{
809
806
ins_pipe(pipe_slow);
810
807
%}
811
808
809
+ // vector and reduction
810
+
811
+ instruct reduce_andI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vReg tmp) %{
812
+ predicate(Matcher::vector_element_basic_type(n->in(2)) != T_LONG);
813
+ match(Set dst (AndReductionV src1 src2));
814
+ effect(TEMP tmp);
815
+ ins_cost(VEC_COST);
816
+ format %{ "vmv.s.x $tmp, $src1\t#@reduce_andI\n\t"
817
+ "vredand.vs $tmp, $src2, $tmp\n\t"
818
+ "vmv.x.s $dst, $tmp" %}
819
+ ins_encode %{
820
+ BasicType bt = Matcher::vector_element_basic_type(this, $src2);
821
+ __ reduce_operation($dst$$Register, as_VectorRegister($tmp$$reg),
822
+ $src1$$Register, as_VectorRegister($src2$$reg), bt, REDUCTION_OP::AND);
823
+ %}
824
+ ins_pipe(pipe_slow);
825
+ %}
826
+
827
+ instruct reduce_andL(iRegLNoSp dst, iRegL src1, vReg src2, vReg tmp) %{
828
+ predicate(Matcher::vector_element_basic_type(n->in(2)) == T_LONG);
829
+ match(Set dst (AndReductionV src1 src2));
830
+ effect(TEMP tmp);
831
+ ins_cost(VEC_COST);
832
+ format %{ "vmv.s.x $tmp, $src1\t#@reduce_andL\n\t"
833
+ "vredand.vs $tmp, $src2, $tmp\n\t"
834
+ "vmv.x.s $dst, $tmp" %}
835
+ ins_encode %{
836
+ BasicType bt = Matcher::vector_element_basic_type(this, $src2);
837
+ __ reduce_operation($dst$$Register, as_VectorRegister($tmp$$reg),
838
+ $src1$$Register, as_VectorRegister($src2$$reg), bt, REDUCTION_OP::AND);
839
+ %}
840
+ ins_pipe(pipe_slow);
841
+ %}
842
+
843
+ // vector or reduction
844
+
845
+ instruct reduce_orI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vReg tmp) %{
846
+ predicate(Matcher::vector_element_basic_type(n->in(2)) != T_LONG);
847
+ match(Set dst (OrReductionV src1 src2));
848
+ effect(TEMP tmp);
849
+ ins_cost(VEC_COST);
850
+ format %{ "vmv.s.x $tmp, $src1\t#@reduce_orI\n\t"
851
+ "vredor.vs $tmp, $src2, $tmp\n\t"
852
+ "vmv.x.s $dst, $tmp" %}
853
+ ins_encode %{
854
+ BasicType bt = Matcher::vector_element_basic_type(this, $src2);
855
+ __ reduce_operation($dst$$Register, as_VectorRegister($tmp$$reg),
856
+ $src1$$Register, as_VectorRegister($src2$$reg), bt, REDUCTION_OP::OR);
857
+ %}
858
+ ins_pipe(pipe_slow);
859
+ %}
860
+
861
+ instruct reduce_orL(iRegLNoSp dst, iRegL src1, vReg src2, vReg tmp) %{
862
+ predicate(Matcher::vector_element_basic_type(n->in(2)) == T_LONG);
863
+ match(Set dst (OrReductionV src1 src2));
864
+ effect(TEMP tmp);
865
+ ins_cost(VEC_COST);
866
+ format %{ "vmv.s.x $tmp, $src1\t#@reduce_orL\n\t"
867
+ "vredor.vs $tmp, $src2, $tmp\n\t"
868
+ "vmv.x.s $dst, $tmp" %}
869
+ ins_encode %{
870
+ BasicType bt = Matcher::vector_element_basic_type(this, $src2);
871
+ __ reduce_operation($dst$$Register, as_VectorRegister($tmp$$reg),
872
+ $src1$$Register, as_VectorRegister($src2$$reg), bt, REDUCTION_OP::OR);
873
+ %}
874
+ ins_pipe(pipe_slow);
875
+ %}
876
+
877
+ // vector xor reduction
878
+
879
+ instruct reduce_xorI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vReg tmp) %{
880
+ predicate(Matcher::vector_element_basic_type(n->in(2)) != T_LONG);
881
+ match(Set dst (XorReductionV src1 src2));
882
+ effect(TEMP tmp);
883
+ ins_cost(VEC_COST);
884
+ format %{ "vmv.s.x $tmp, $src1\t#@reduce_xorI\n\t"
885
+ "vredxor.vs $tmp, $src2, $tmp\n\t"
886
+ "vmv.x.s $dst, $tmp" %}
887
+ ins_encode %{
888
+ BasicType bt = Matcher::vector_element_basic_type(this, $src2);
889
+ __ reduce_operation($dst$$Register, as_VectorRegister($tmp$$reg),
890
+ $src1$$Register, as_VectorRegister($src2$$reg), bt, REDUCTION_OP::XOR);
891
+ %}
892
+ ins_pipe(pipe_slow);
893
+ %}
894
+
895
+ instruct reduce_xorL(iRegLNoSp dst, iRegL src1, vReg src2, vReg tmp) %{
896
+ predicate(Matcher::vector_element_basic_type(n->in(2)) == T_LONG);
897
+ match(Set dst (XorReductionV src1 src2));
898
+ effect(TEMP tmp);
899
+ ins_cost(VEC_COST);
900
+ format %{ "vmv.s.x $tmp, $src1\t#@reduce_xorL\n\t"
901
+ "vredxor.vs $tmp, $src2, $tmp\n\t"
902
+ "vmv.x.s $dst, $tmp" %}
903
+ ins_encode %{
904
+ BasicType bt = Matcher::vector_element_basic_type(this, $src2);
905
+ __ reduce_operation($dst$$Register, as_VectorRegister($tmp$$reg),
906
+ $src1$$Register, as_VectorRegister($src2$$reg), bt, REDUCTION_OP::XOR);
907
+ %}
908
+ ins_pipe(pipe_slow);
909
+ %}
910
+
812
911
// vector add reduction
813
912
814
913
instruct reduce_addB(iRegINoSp dst, iRegIorL2I src1, vReg src2, vReg tmp) %{
0 commit comments