11/*
2- * Copyright (c) 2007, 2024 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2007, 2025 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -666,7 +666,7 @@ VectorNode* VectorNode::make_mask_node(int vopc, Node* n1, Node* n2, uint vlen,
666666 }
667667}
668668
669- // Make a vector node for binary operation
669+ // Make a vector node for unary or binary operation
670670VectorNode* VectorNode::make (int vopc, Node* n1, Node* n2, const TypeVect* vt, bool is_mask, bool is_var_shift, bool is_unsigned) {
671671 // This method should not be called for unimplemented vectors.
672672 guarantee (vopc > 0 , " vopc must be > 0" );
@@ -747,6 +747,9 @@ VectorNode* VectorNode::make(int vopc, Node* n1, Node* n2, const TypeVect* vt, b
747747 case Op_URShiftVI: return new URShiftVINode (n1, n2, vt, is_var_shift);
748748 case Op_URShiftVL: return new URShiftVLNode (n1, n2, vt, is_var_shift);
749749
750+ case Op_LShiftCntV: return new LShiftCntVNode (n1, vt);
751+ case Op_RShiftCntV: return new RShiftCntVNode (n1, vt);
752+
750753 case Op_AndV: return new AndVNode (n1, n2, vt);
751754 case Op_OrV: return new OrVNode (n1, n2, vt);
752755 case Op_XorV: return new XorVNode (n1, n2, vt);
@@ -766,6 +769,18 @@ VectorNode* VectorNode::make(int vopc, Node* n1, Node* n2, const TypeVect* vt, b
766769 case Op_SaturatingAddV: return new SaturatingAddVNode (n1, n2, vt, is_unsigned);
767770 case Op_SaturatingSubV: return new SaturatingSubVNode (n1, n2, vt, is_unsigned);
768771
772+ case Op_VectorCastB2X: return new VectorCastB2XNode (n1, vt);
773+ case Op_VectorCastS2X: return new VectorCastS2XNode (n1, vt);
774+ case Op_VectorCastI2X: return new VectorCastI2XNode (n1, vt);
775+ case Op_VectorCastL2X: return new VectorCastL2XNode (n1, vt);
776+ case Op_VectorCastF2X: return new VectorCastF2XNode (n1, vt);
777+ case Op_VectorCastD2X: return new VectorCastD2XNode (n1, vt);
778+ case Op_VectorUCastB2X: return new VectorUCastB2XNode (n1, vt);
779+ case Op_VectorUCastS2X: return new VectorUCastS2XNode (n1, vt);
780+ case Op_VectorUCastI2X: return new VectorUCastI2XNode (n1, vt);
781+ case Op_VectorCastHF2F: return new VectorCastHF2FNode (n1, vt);
782+ case Op_VectorCastF2HF: return new VectorCastF2HFNode (n1, vt);
783+
769784 default :
770785 fatal (" Missed vector creation for '%s'" , NodeClassNames[vopc]);
771786 return nullptr ;
@@ -791,6 +806,7 @@ VectorNode* VectorNode::make(int vopc, Node* n1, Node* n2, Node* n3, const TypeV
791806 case Op_SelectFromTwoVector: return new SelectFromTwoVectorNode (n1, n2, n3, vt);
792807 case Op_SignumVD: return new SignumVDNode (n1, n2, n3, vt);
793808 case Op_SignumVF: return new SignumVFNode (n1, n2, n3, vt);
809+ case Op_VectorBlend: return new VectorBlendNode (n1, n2, n3);
794810 default :
795811 fatal (" Missed vector creation for '%s'" , NodeClassNames[vopc]);
796812 return nullptr ;
@@ -818,22 +834,26 @@ VectorNode* VectorNode::scalar2vector(Node* s, uint vlen, BasicType bt, bool is_
818834}
819835
820836VectorNode* VectorNode::shift_count (int opc, Node* cnt, uint vlen, BasicType bt) {
821- // Match shift count type with shift vector type.
837+ int vopc = VectorNode::shift_count_opcode (opc);
822838 const TypeVect* vt = TypeVect::make (bt, vlen);
839+ return VectorNode::make (vopc, cnt, nullptr , vt);
840+ }
841+
842+ int VectorNode::shift_count_opcode (int opc) {
823843 switch (opc) {
824844 case Op_LShiftI:
825845 case Op_LShiftL:
826- return new LShiftCntVNode (cnt, vt) ;
846+ return Op_LShiftCntV ;
827847 case Op_RShiftI:
828848 case Op_RShiftL:
829849 case Op_URShiftB:
830850 case Op_URShiftS:
831851 case Op_URShiftI:
832852 case Op_URShiftL:
833- return new RShiftCntVNode (cnt, vt) ;
853+ return Op_RShiftCntV ;
834854 default :
835- fatal (" Missed vector creation for '%s'" , NodeClassNames[opc]);
836- return nullptr ;
855+ fatal (" Node class '%s' is not supported for shift count " , NodeClassNames[opc]);
856+ return - 1 ;
837857 }
838858}
839859
@@ -1412,24 +1432,9 @@ VectorStoreMaskNode* VectorStoreMaskNode::make(PhaseGVN& gvn, Node* in, BasicTyp
14121432 return new VectorStoreMaskNode (in, gvn.intcon (elem_size), vt);
14131433}
14141434
1415- VectorCastNode * VectorCastNode::make (int vopc, Node* n1, BasicType bt, uint vlen) {
1435+ VectorNode * VectorCastNode::make (int vopc, Node* n1, BasicType bt, uint vlen) {
14161436 const TypeVect* vt = TypeVect::make (bt, vlen);
1417- switch (vopc) {
1418- case Op_VectorCastB2X: return new VectorCastB2XNode (n1, vt);
1419- case Op_VectorCastS2X: return new VectorCastS2XNode (n1, vt);
1420- case Op_VectorCastI2X: return new VectorCastI2XNode (n1, vt);
1421- case Op_VectorCastL2X: return new VectorCastL2XNode (n1, vt);
1422- case Op_VectorCastF2X: return new VectorCastF2XNode (n1, vt);
1423- case Op_VectorCastD2X: return new VectorCastD2XNode (n1, vt);
1424- case Op_VectorUCastB2X: return new VectorUCastB2XNode (n1, vt);
1425- case Op_VectorUCastS2X: return new VectorUCastS2XNode (n1, vt);
1426- case Op_VectorUCastI2X: return new VectorUCastI2XNode (n1, vt);
1427- case Op_VectorCastHF2F: return new VectorCastHF2FNode (n1, vt);
1428- case Op_VectorCastF2HF: return new VectorCastF2HFNode (n1, vt);
1429- default :
1430- assert (false , " unknown node: %s" , NodeClassNames[vopc]);
1431- return nullptr ;
1432- }
1437+ return VectorNode::make (vopc, n1, nullptr , vt);
14331438}
14341439
14351440int VectorCastNode::opcode (int sopc, BasicType bt, bool is_signed) {
0 commit comments