diff --git a/src/hotspot/share/opto/superword.cpp b/src/hotspot/share/opto/superword.cpp index 7850e19f16d..d488d0eba5f 100644 --- a/src/hotspot/share/opto/superword.cpp +++ b/src/hotspot/share/opto/superword.cpp @@ -2558,6 +2558,14 @@ void SuperWord::output() { Node* in = vector_opd(p, 1); vn = VectorNode::make(opc, in, NULL, vlen, velt_basic_type(n)); vlen_in_bytes = vn->as_Vector()->length_in_bytes(); + } else if (opc == Op_ConvI2F || opc == Op_ConvL2D || + opc == Op_ConvF2I || opc == Op_ConvD2L) { + assert(n->req() == 2, "only one input expected"); + BasicType bt = velt_basic_type(n); + int vopc = VectorNode::opcode(opc, bt); + Node* in = vector_opd(p, 1); + vn = VectorCastNode::make(vopc, in, bt, vlen); + vlen_in_bytes = vn->as_Vector()->length_in_bytes(); } else if (is_cmov_pack(p)) { if (can_process_post_loop) { // do not refactor of flow in post loop context diff --git a/src/hotspot/share/opto/vectornode.cpp b/src/hotspot/share/opto/vectornode.cpp index 6a5b0b9b014..6d845271e47 100644 --- a/src/hotspot/share/opto/vectornode.cpp +++ b/src/hotspot/share/opto/vectornode.cpp @@ -224,6 +224,14 @@ int VectorNode::opcode(int sopc, BasicType bt) { return Op_StoreVector; case Op_MulAddS2I: return Op_MulAddVS2VI; + case Op_ConvI2F: + return Op_VectorCastI2X; + case Op_ConvL2D: + return Op_VectorCastL2X; + case Op_ConvF2I: + return Op_VectorCastF2X; + case Op_ConvD2L: + return Op_VectorCastD2X; default: return 0; // Unimplemented diff --git a/test/hotspot/jtreg/compiler/codegen/TestIntFloatVect.java b/test/hotspot/jtreg/compiler/codegen/TestIntFloatVect.java index 9074a699738..be8acc6cb29 100644 --- a/test/hotspot/jtreg/compiler/codegen/TestIntFloatVect.java +++ b/test/hotspot/jtreg/compiler/codegen/TestIntFloatVect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -75,6 +75,8 @@ public class TestIntFloatVect { test_vi_unaln(a1, b1, (int)123, 103.f); test_cp_unalndst(a1, a2, b1, b2); test_cp_unalnsrc(a1, a2, b1, b2); + test_conv_i2f(a1, b1); + test_conv_f2i(a1, b1); } // Initialize for (int i=0; i