@@ -59,48 +59,6 @@ static bool check_vbox(const TypeInstPtr* vbox_type) {
5959}
6060#endif
6161
62- bool LibraryCallKit::arch_supports_vector_rotate (int opc, int num_elem, BasicType elem_bt, bool has_scalar_args) {
63- bool is_supported = true ;
64- // has_scalar_args flag is true only for non-constant scalar shift count,
65- // since in this case shift needs to be broadcasted.
66- if (!Matcher::match_rule_supported_vector (opc, num_elem, elem_bt) ||
67- (has_scalar_args &&
68- !arch_supports_vector (VectorNode::replicate_opcode (elem_bt), num_elem, elem_bt, VecMaskNotUsed))) {
69- is_supported = false ;
70- }
71-
72- int lshiftopc, rshiftopc;
73- switch (elem_bt) {
74- case T_BYTE :
75- lshiftopc = Op_LShiftI;
76- rshiftopc = Op_URShiftB;
77- break ;
78- case T_SHORT :
79- lshiftopc = Op_LShiftI;
80- rshiftopc = Op_URShiftS;
81- break ;
82- case T_INT :
83- lshiftopc = Op_LShiftI;
84- rshiftopc = Op_URShiftI;
85- break ;
86- case T_LONG :
87- lshiftopc = Op_LShiftL;
88- rshiftopc = Op_URShiftL;
89- break ;
90- default :
91- assert (false , " Unexpected type" );
92- }
93- int lshiftvopc = VectorNode::opcode (lshiftopc, elem_bt);
94- int rshiftvopc = VectorNode::opcode (rshiftopc, elem_bt);
95- if (!is_supported &&
96- arch_supports_vector (lshiftvopc, num_elem, elem_bt, VecMaskNotUsed) &&
97- arch_supports_vector (rshiftvopc, num_elem, elem_bt, VecMaskNotUsed) &&
98- arch_supports_vector (Op_OrV, num_elem, elem_bt, VecMaskNotUsed)) {
99- is_supported = true ;
100- }
101- return is_supported;
102- }
103-
10462Node* GraphKit::box_vector (Node* vector, const TypeInstPtr* vbox_type, BasicType elem_bt, int num_elem, bool deoptimize_on_exception) {
10563 assert (EnableVectorSupport, " " );
10664
@@ -154,29 +112,17 @@ bool LibraryCallKit::arch_supports_vector(int sopc, int num_elem, BasicType type
154112 return false ;
155113 }
156114
157- if ( VectorNode::is_vector_rotate (sopc)) {
158- if (! arch_supports_vector_rotate (sopc, num_elem, type, has_scalar_args )) {
115+ // Check that architecture supports this op-size-type combination.
116+ if (! Matcher::match_rule_supported_vector (sopc, num_elem, type)) {
159117#ifndef PRODUCT
160- if (C->print_intrinsics ()) {
161- tty->print_cr (" ** Rejected vector op (%s,%s,%d) because architecture does not support variable vector shifts" ,
162- NodeClassNames[sopc], type2name (type), num_elem);
163- }
164- #endif
165- return false ;
118+ if (C->print_intrinsics ()) {
119+ tty->print_cr (" ** Rejected vector op (%s,%s,%d) because architecture does not support it" ,
120+ NodeClassNames[sopc], type2name (type), num_elem);
166121 }
167- } else {
168- // Check that architecture supports this op-size-type combination.
169- if (!Matcher::match_rule_supported_vector (sopc, num_elem, type)) {
170- #ifndef PRODUCT
171- if (C->print_intrinsics ()) {
172- tty->print_cr (" ** Rejected vector op (%s,%s,%d) because architecture does not support it" ,
173- NodeClassNames[sopc], type2name (type), num_elem);
174- }
175122#endif
176- return false ;
177- } else {
178- assert (Matcher::match_rule_supported (sopc), " must be supported" );
179- }
123+ return false ;
124+ } else {
125+ assert (Matcher::match_rule_supported (sopc), " must be supported" );
180126 }
181127
182128 if (num_elem == 1 ) {
@@ -1554,9 +1500,7 @@ bool LibraryCallKit::inline_vector_broadcast_int() {
15541500 BasicType elem_bt = elem_type->basic_type ();
15551501 int num_elem = vlen->get_con ();
15561502 int opc = VectorSupport::vop2ideal (opr->get_con (), elem_bt);
1557- bool is_shift = VectorNode::is_shift_opcode (opc);
1558- bool is_rotate = VectorNode::is_rotate_opcode (opc);
1559- if (opc == 0 || (!is_shift && !is_rotate)) {
1503+ if (opc == 0 || !VectorNode::is_shift_opcode (opc)) {
15601504 if (C->print_intrinsics ()) {
15611505 tty->print_cr (" ** operation not supported: op=%d bt=%s" , opr->get_con (), type2name (elem_bt));
15621506 }
@@ -1569,37 +1513,18 @@ bool LibraryCallKit::inline_vector_broadcast_int() {
15691513 }
15701514 return false ; // operation not supported
15711515 }
1572- Node* cnt = argument (5 );
15731516 ciKlass* vbox_klass = vector_klass->const_oop ()->as_instance ()->java_lang_Class_klass ();
15741517 const TypeInstPtr* vbox_type = TypeInstPtr::make_exact (TypePtr::NotNull, vbox_klass);
1575- const TypeInt* cnt_type = cnt->bottom_type ()->isa_int ();
15761518
1577- // If CPU supports vector constant rotate instructions pass it directly
1578- bool is_const_rotate = is_rotate && cnt_type && cnt_type->is_con () &&
1579- Matcher::supports_vector_constant_rotates (cnt_type->get_con ());
1580- bool has_scalar_args = is_rotate ? !is_const_rotate : true ;
1581- if (!arch_supports_vector (sopc, num_elem, elem_bt, VecMaskNotUsed, has_scalar_args)) {
1519+ if (!arch_supports_vector (sopc, num_elem, elem_bt, VecMaskNotUsed, true /* has_scalar_args*/ )) {
15821520 if (C->print_intrinsics ()) {
15831521 tty->print_cr (" ** not supported: arity=0 op=int/%d vlen=%d etype=%s ismask=no" ,
15841522 sopc, num_elem, type2name (elem_bt));
15851523 }
15861524 return false ; // not supported
15871525 }
15881526 Node* opd1 = unbox_vector (argument (4 ), vbox_type, elem_bt, num_elem);
1589- Node* opd2 = NULL ;
1590- if (is_shift) {
1591- opd2 = vector_shift_count (cnt, opc, elem_bt, num_elem);
1592- } else {
1593- assert (is_rotate, " unexpected operation" );
1594- if (!is_const_rotate) {
1595- const Type * type_bt = Type::get_const_basic_type (elem_bt);
1596- cnt = elem_bt == T_LONG ? gvn ().transform (new ConvI2LNode (cnt)) : cnt;
1597- opd2 = gvn ().transform (VectorNode::scalar2vector (cnt, num_elem, type_bt));
1598- } else {
1599- // Constant shift value.
1600- opd2 = cnt;
1601- }
1602- }
1527+ Node* opd2 = vector_shift_count (argument (5 ), opc, elem_bt, num_elem);
16031528 if (opd1 == NULL || opd2 == NULL ) {
16041529 return false ;
16051530 }
0 commit comments