--- old/src/hotspot/share/opto/vectornode.cpp 2020-08-07 00:36:33.000000000 +0300 +++ new/src/hotspot/share/opto/vectornode.cpp 2020-08-07 00:36:33.000000000 +0300 @@ -178,8 +178,6 @@ case Op_SqrtD: assert(bt == T_DOUBLE, "must be"); return Op_SqrtVD; - case Op_Not: - return Op_NotV; case Op_PopCountI: if (bt == T_INT) { return Op_PopCountVI; @@ -285,10 +283,9 @@ case T_DOUBLE: return Op_ReplicateD; default: - break; + assert(false, "wrong type: %s", type2name(bt)); + return 0; } - - return 0; } // Also used to check if the code generator @@ -343,28 +340,6 @@ } } -bool VectorNode::is_vshift(Node* n) { - switch (n->Opcode()) { - case Op_LShiftVB: - case Op_LShiftVS: - case Op_LShiftVI: - case Op_LShiftVL: - - case Op_RShiftVB: - case Op_RShiftVS: - case Op_RShiftVI: - case Op_RShiftVL: - - case Op_URShiftVB: - case Op_URShiftVS: - case Op_URShiftVI: - case Op_URShiftVL: - return true; - default: - return false; - } -} - bool VectorNode::is_vshift_cnt(Node* n) { switch (n->Opcode()) { case Op_LShiftCntV: @@ -473,7 +448,6 @@ case Op_MinV: return new MinVNode(n1, n2, vt); case Op_MaxV: return new MaxVNode(n1, n2, vt); - case Op_AbsV: return new AbsVNode(n1, vt); case Op_AbsVF: return new AbsVFNode(n1, vt); case Op_AbsVD: return new AbsVDNode(n1, vt); case Op_AbsVB: return new AbsVBNode(n1, vt); @@ -489,7 +463,6 @@ case Op_SqrtVD: return new SqrtVDNode(n1, vt); case Op_PopCountVI: return new PopCountVINode(n1, vt); - case Op_NotV: return new NotVNode(n1, vt); case Op_LShiftVB: return new LShiftVBNode(n1, n2, vt); case Op_LShiftVS: return new LShiftVSNode(n1, n2, vt); @@ -506,11 +479,6 @@ case Op_URShiftVI: return new URShiftVINode(n1, n2, vt); case Op_URShiftVL: return new URShiftVLNode(n1, n2, vt); - // Variable shift left - case Op_VLShiftV: return new VLShiftVNode(n1, n2, vt); - case Op_VRShiftV: return new VRShiftVNode(n1, n2, vt); - case Op_VURShiftV: return new VURShiftVNode(n1, n2, vt); - case Op_AndV: return new AndVNode(n1, n2, vt); case Op_OrV: return new OrVNode (n1, n2, vt); case Op_XorV: return new XorVNode(n1, n2, vt); @@ -745,24 +713,16 @@ int ExtractNode::opcode(BasicType bt) { switch (bt) { - case T_BOOLEAN: - return Op_ExtractUB; - case T_BYTE: - return Op_ExtractB; - case T_CHAR: - return Op_ExtractC; - case T_SHORT: - return Op_ExtractS; - case T_INT: - return Op_ExtractI; - case T_LONG: - return Op_ExtractL; - case T_FLOAT: - return Op_ExtractF; - case T_DOUBLE: - return Op_ExtractD; + case T_BOOLEAN: return Op_ExtractUB; + case T_BYTE: return Op_ExtractB; + case T_CHAR: return Op_ExtractC; + case T_SHORT: return Op_ExtractS; + case T_INT: return Op_ExtractI; + case T_LONG: return Op_ExtractL; + case T_FLOAT: return Op_ExtractF; + case T_DOUBLE: return Op_ExtractD; default: - fatal("Type '%s' is not supported for vectors", type2name(bt)); + assert(false, "wrong type: %s", type2name(bt)); return 0; } } @@ -772,24 +732,16 @@ assert((int)position < Matcher::max_vector_size(bt), "pos in range"); ConINode* pos = ConINode::make((int)position); switch (bt) { - case T_BOOLEAN: - return new ExtractUBNode(v, pos); - case T_BYTE: - return new ExtractBNode(v, pos); - case T_CHAR: - return new ExtractCNode(v, pos); - case T_SHORT: - return new ExtractSNode(v, pos); - case T_INT: - return new ExtractINode(v, pos); - case T_LONG: - return new ExtractLNode(v, pos); - case T_FLOAT: - return new ExtractFNode(v, pos); - case T_DOUBLE: - return new ExtractDNode(v, pos); + case T_BOOLEAN: return new ExtractUBNode(v, pos); + case T_BYTE: return new ExtractBNode(v, pos); + case T_CHAR: return new ExtractCNode(v, pos); + case T_SHORT: return new ExtractSNode(v, pos); + case T_INT: return new ExtractINode(v, pos); + case T_LONG: return new ExtractLNode(v, pos); + case T_FLOAT: return new ExtractFNode(v, pos); + case T_DOUBLE: return new ExtractDNode(v, pos); default: - fatal("Type '%s' is not supported for vectors", type2name(bt)); + assert(false, "wrong type: %s", type2name(bt)); return NULL; } } @@ -806,7 +758,7 @@ case T_INT: vopc = Op_AddReductionVI; break; - default: ShouldNotReachHere(); return 0; + default: ShouldNotReachHere(); return 0; } break; case Op_AddL: @@ -830,7 +782,7 @@ case T_INT: vopc = Op_MulReductionVI; break; - default: ShouldNotReachHere(); return 0; + default: ShouldNotReachHere(); return 0; } break; case Op_MulL: @@ -970,11 +922,18 @@ case Op_OrReductionV: return new OrReductionVNode(ctrl, n1, n2); case Op_XorReductionV: return new XorReductionVNode(ctrl, n1, n2); default: - fatal("Missed vector creation for '%s'", NodeClassNames[vopc]); + assert(false, "unknown node: %s", NodeClassNames[vopc]); return NULL; } } +VectorStoreMaskNode* VectorStoreMaskNode::make(PhaseGVN& gvn, Node* in, BasicType in_type, uint num_elem) { + assert(in->bottom_type()->isa_vect(), "sanity"); + const TypeVect* vt = TypeVect::make(T_BOOLEAN, num_elem); + int elem_size = type2aelembytes(in_type); + return new VectorStoreMaskNode(in, gvn.intcon(elem_size), vt); +} + VectorCastNode* VectorCastNode::make(int vopc, Node* n1, BasicType bt, uint vlen) { const TypeVect* vt = TypeVect::make(bt, vlen); switch (vopc) { @@ -984,9 +943,10 @@ case Op_VectorCastL2X: return new VectorCastL2XNode(n1, vt); case Op_VectorCastF2X: return new VectorCastF2XNode(n1, vt); case Op_VectorCastD2X: return new VectorCastD2XNode(n1, vt); - default: fatal("unknown node: %s", NodeClassNames[vopc]); + default: + assert(false, "unknown node: %s", NodeClassNames[vopc]); + return NULL; } - return NULL; } int VectorCastNode::opcode(BasicType bt) { @@ -997,9 +957,10 @@ case T_LONG: return Op_VectorCastL2X; case T_FLOAT: return Op_VectorCastF2X; case T_DOUBLE: return Op_VectorCastD2X; - default: Unimplemented(); + default: + assert(false, "unknown type: %s", type2name(bt)); + return 0; } - return 0; } Node* ReductionNode::make_reduction_input(PhaseGVN& gvn, int opc, BasicType bt) { @@ -1081,6 +1042,16 @@ return false; } +MacroLogicVNode* MacroLogicVNode::make(PhaseGVN& gvn, Node* in1, Node* in2, Node* in3, + uint truth_table, const TypeVect* vt) { + assert(truth_table <= 0xFF, "invalid"); + assert(in1->bottom_type()->is_vect()->length_in_bytes() == vt->length_in_bytes(), "mismatch"); + assert(in2->bottom_type()->is_vect()->length_in_bytes() == vt->length_in_bytes(), "mismatch"); + assert(in3->bottom_type()->is_vect()->length_in_bytes() == vt->length_in_bytes(), "mismatch"); + Node* fn = gvn.intcon(truth_table); + return new MacroLogicVNode(in1, in2, in3, fn, vt); +} + #ifndef PRODUCT void VectorMaskCmpNode::dump_spec(outputStream *st) const { st->print(" %d #", _predicate); _type->dump_on(st); @@ -1129,14 +1100,3 @@ CallStaticJavaNode::dump_spec(st); } #endif // !PRODUCT - -MacroLogicVNode* MacroLogicVNode::make(PhaseGVN& gvn, Node* in1, Node* in2, Node* in3, - uint truth_table, const TypeVect* vt) { - assert(truth_table <= 0xFF, "invalid"); - assert(in1->bottom_type()->is_vect()->length_in_bytes() == vt->length_in_bytes(), "mismatch"); - assert(in2->bottom_type()->is_vect()->length_in_bytes() == vt->length_in_bytes(), "mismatch"); - assert(in3->bottom_type()->is_vect()->length_in_bytes() == vt->length_in_bytes(), "mismatch"); - Node* fn = gvn.intcon(truth_table); - return new MacroLogicVNode(in1, in2, in3, fn, vt); -} -