8321021: RISC-V: C2 VectorUCastB2X

8321023: RISC-V: C2 VectorUCastS2X
8321024: RISC-V: C2 VectorUCastI2X

Reviewed-by: fyang
This commit is contained in:
Hamlin Li 2024-03-14 11:23:00 +00:00
parent 3b9255eb66
commit 1d34b74a64
5 changed files with 628 additions and 34 deletions

View File

@ -2791,7 +2791,7 @@ void C2_MacroAssembler::compare_fp_v(VectorRegister vd, VectorRegister src1, Vec
}
void C2_MacroAssembler::integer_extend_v(VectorRegister dst, BasicType dst_bt, uint vector_length,
VectorRegister src, BasicType src_bt) {
VectorRegister src, BasicType src_bt, bool is_signed) {
assert(type2aelembytes(dst_bt) > type2aelembytes(src_bt) && type2aelembytes(dst_bt) <= 8 && type2aelembytes(src_bt) <= 4, "invalid element size");
assert(dst_bt != T_FLOAT && dst_bt != T_DOUBLE && src_bt != T_FLOAT && src_bt != T_DOUBLE, "unsupported element type");
// https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#52-vector-operands
@ -2801,28 +2801,54 @@ void C2_MacroAssembler::integer_extend_v(VectorRegister dst, BasicType dst_bt, u
assert_different_registers(dst, src);
vsetvli_helper(dst_bt, vector_length);
if (src_bt == T_BYTE) {
switch (dst_bt) {
case T_SHORT:
if (is_signed) {
if (src_bt == T_BYTE) {
switch (dst_bt) {
case T_SHORT:
vsext_vf2(dst, src);
break;
case T_INT:
vsext_vf4(dst, src);
break;
case T_LONG:
vsext_vf8(dst, src);
break;
default:
ShouldNotReachHere();
}
} else if (src_bt == T_SHORT) {
if (dst_bt == T_INT) {
vsext_vf2(dst, src);
} else {
vsext_vf4(dst, src);
}
} else if (src_bt == T_INT) {
vsext_vf2(dst, src);
break;
case T_INT:
vsext_vf4(dst, src);
break;
case T_LONG:
vsext_vf8(dst, src);
break;
default:
ShouldNotReachHere();
}
} else if (src_bt == T_SHORT) {
if (dst_bt == T_INT) {
vsext_vf2(dst, src);
} else {
vsext_vf4(dst, src);
} else {
if (src_bt == T_BYTE) {
switch (dst_bt) {
case T_SHORT:
vzext_vf2(dst, src);
break;
case T_INT:
vzext_vf4(dst, src);
break;
case T_LONG:
vzext_vf8(dst, src);
break;
default:
ShouldNotReachHere();
}
} else if (src_bt == T_SHORT) {
if (dst_bt == T_INT) {
vzext_vf2(dst, src);
} else {
vzext_vf4(dst, src);
}
} else if (src_bt == T_INT) {
vzext_vf2(dst, src);
}
} else if (src_bt == T_INT) {
vsext_vf2(dst, src);
}
}

View File

@ -276,7 +276,7 @@
}
void integer_extend_v(VectorRegister dst, BasicType dst_bt, uint vector_length,
VectorRegister src, BasicType src_bt);
VectorRegister src, BasicType src_bt, bool is_signed);
void integer_narrow_v(VectorRegister dst, BasicType dst_bt, uint vector_length,
VectorRegister src, BasicType src_bt);

View File

@ -3189,7 +3189,7 @@ instruct vblend(vReg dst, vReg src1, vReg src2, vRegMask_V0 v0) %{
// ------------------------------ Vector cast ----------------------------------
// VectorCastB2X
// VectorCastB2X, VectorUCastB2X
instruct vcvtBtoX(vReg dst, vReg src) %{
match(Set dst (VectorCastB2X src));
@ -3199,18 +3199,36 @@ instruct vcvtBtoX(vReg dst, vReg src) %{
BasicType bt = Matcher::vector_element_basic_type(this);
if (is_floating_point_type(bt)) {
__ integer_extend_v(as_VectorRegister($dst$$reg), bt == T_FLOAT ? T_INT : T_LONG,
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_BYTE);
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_BYTE,
true /* is_signed */);
__ csrwi(CSR_FRM, C2_MacroAssembler::rne);
__ vfcvt_f_x_v(as_VectorRegister($dst$$reg), as_VectorRegister($dst$$reg));
} else {
__ integer_extend_v(as_VectorRegister($dst$$reg), bt,
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_BYTE);
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_BYTE,
true /* is_signed */);
}
%}
ins_pipe(pipe_slow);
%}
// VectorCastS2X
instruct vcvtUBtoX(vReg dst, vReg src) %{
predicate(Matcher::vector_element_basic_type(n) == T_SHORT ||
Matcher::vector_element_basic_type(n) == T_INT ||
Matcher::vector_element_basic_type(n) == T_LONG);
match(Set dst (VectorUCastB2X src));
effect(TEMP_DEF dst);
format %{ "vcvtUBtoX $dst, $src" %}
ins_encode %{
BasicType bt = Matcher::vector_element_basic_type(this);
__ integer_extend_v(as_VectorRegister($dst$$reg), bt,
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_BYTE,
false /* is_signed */);
%}
ins_pipe(pipe_slow);
%}
// VectorCastS2X, VectorUCastS2X
instruct vcvtStoB(vReg dst, vReg src) %{
predicate(Matcher::vector_element_basic_type(n) == T_BYTE);
@ -3223,29 +3241,31 @@ instruct vcvtStoB(vReg dst, vReg src) %{
ins_pipe(pipe_slow);
%}
instruct vcvtStoX_extend(vReg dst, vReg src) %{
instruct vcvtStoX(vReg dst, vReg src) %{
predicate((Matcher::vector_element_basic_type(n) == T_INT ||
Matcher::vector_element_basic_type(n) == T_LONG));
match(Set dst (VectorCastS2X src));
effect(TEMP_DEF dst);
format %{ "vcvtStoX_extend $dst, $src" %}
format %{ "vcvtStoX $dst, $src" %}
ins_encode %{
__ integer_extend_v(as_VectorRegister($dst$$reg), Matcher::vector_element_basic_type(this),
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_SHORT);
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_SHORT,
true /* is_signed */);
%}
ins_pipe(pipe_slow);
%}
instruct vcvtStoX_fp_extend(vReg dst, vReg src) %{
instruct vcvtStoX_fp(vReg dst, vReg src) %{
predicate((Matcher::vector_element_basic_type(n) == T_FLOAT ||
Matcher::vector_element_basic_type(n) == T_DOUBLE));
match(Set dst (VectorCastS2X src));
effect(TEMP_DEF dst);
format %{ "vcvtStoX_fp_extend $dst, $src" %}
format %{ "vcvtStoX_fp $dst, $src" %}
ins_encode %{
BasicType bt = Matcher::vector_element_basic_type(this);
__ integer_extend_v(as_VectorRegister($dst$$reg), (bt == T_FLOAT ? T_INT : T_LONG),
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_SHORT);
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_SHORT,
true /* is_signed */);
__ vsetvli_helper(bt, Matcher::vector_length(this));
__ csrwi(CSR_FRM, C2_MacroAssembler::rne);
__ vfcvt_f_x_v(as_VectorRegister($dst$$reg), as_VectorRegister($dst$$reg));
@ -3253,7 +3273,22 @@ instruct vcvtStoX_fp_extend(vReg dst, vReg src) %{
ins_pipe(pipe_slow);
%}
// VectorCastI2X
instruct vcvtUStoX(vReg dst, vReg src) %{
predicate(Matcher::vector_element_basic_type(n) == T_INT ||
Matcher::vector_element_basic_type(n) == T_LONG);
match(Set dst (VectorUCastS2X src));
effect(TEMP_DEF dst);
format %{ "vcvtUStoX $dst, $src" %}
ins_encode %{
__ integer_extend_v(as_VectorRegister($dst$$reg), Matcher::vector_element_basic_type(this),
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_SHORT,
false /* is_signed */);
%}
ins_pipe(pipe_slow);
%}
// VectorCastI2X, VectorUCastI2X
instruct vcvtItoX_narrow(vReg dst, vReg src) %{
predicate((Matcher::vector_element_basic_type(n) == T_BYTE ||
@ -3275,7 +3310,21 @@ instruct vcvtItoL(vReg dst, vReg src) %{
format %{ "vcvtItoL $dst, $src" %}
ins_encode %{
__ integer_extend_v(as_VectorRegister($dst$$reg), T_LONG,
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_INT);
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_INT,
true /* is_signed */);
%}
ins_pipe(pipe_slow);
%}
instruct vcvtUItoL(vReg dst, vReg src) %{
predicate(Matcher::vector_element_basic_type(n) == T_LONG);
match(Set dst (VectorUCastI2X src));
effect(TEMP_DEF dst);
format %{ "vcvtUItoL $dst, $src" %}
ins_encode %{
__ integer_extend_v(as_VectorRegister($dst$$reg), T_LONG,
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_INT,
false /* is_signed */);
%}
ins_pipe(pipe_slow);
%}

View File

@ -0,0 +1,49 @@
/*
* Copyright (c) 2024, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package compiler.vectorapi.reshape;
import compiler.vectorapi.reshape.tests.TestVectorCast;
import compiler.vectorapi.reshape.utils.TestCastMethods;
import compiler.vectorapi.reshape.utils.VectorReshapeHelper;
/*
* @test
* @bug 8321021 8321023 8321024
* @key randomness
* @modules jdk.incubator.vector
* @modules java.base/jdk.internal.misc
* @summary Test that vector cast intrinsics work as intended on riscv (rvv).
* @requires os.arch == "riscv64" & vm.cpu.features ~= ".*v,.*"
* @library /test/lib /
* @run main/timeout=300 compiler.vectorapi.reshape.TestVectorCastRVV
*/
public class TestVectorCastRVV {
public static void main(String[] args) {
VectorReshapeHelper.runMainHelper(
TestVectorCast.class,
TestCastMethods.RVV_CAST_TESTS.stream(),
"-XX:+UseRVV");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, 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
@ -33,6 +33,476 @@ import static compiler.vectorapi.reshape.utils.VectorSpeciesPair.makePair;
* The cast intrinsics implemented on each platform.
*/
public class TestCastMethods {
public static final List<VectorSpeciesPair> RVV_CAST_TESTS = List.of(
// ====== from B ======
// from B 64
// to X 64
makePair(BSPEC64, SSPEC64),
makePair(BSPEC64, SSPEC64, true),
// to X 128
makePair(BSPEC64, SSPEC128),
makePair(BSPEC64, SSPEC128, true),
makePair(BSPEC64, ISPEC128),
makePair(BSPEC64, ISPEC128, true),
makePair(BSPEC64, FSPEC128),
// to X 256
makePair(BSPEC64, SSPEC256),
makePair(BSPEC64, SSPEC256, true),
makePair(BSPEC64, ISPEC256),
makePair(BSPEC64, ISPEC256, true),
makePair(BSPEC64, LSPEC256),
makePair(BSPEC64, LSPEC256, true),
makePair(BSPEC64, FSPEC256),
makePair(BSPEC64, DSPEC256),
// to X 512
makePair(BSPEC64, SSPEC512),
makePair(BSPEC64, SSPEC512, true),
makePair(BSPEC64, ISPEC512),
makePair(BSPEC64, ISPEC512, true),
makePair(BSPEC64, LSPEC512),
makePair(BSPEC64, LSPEC512, true),
makePair(BSPEC64, FSPEC512),
makePair(BSPEC64, DSPEC512),
// from B 128
// to X 64
makePair(BSPEC128, SSPEC64),
makePair(BSPEC128, SSPEC64, true),
// to X 128
makePair(BSPEC128, SSPEC128),
makePair(BSPEC128, SSPEC128, true),
makePair(BSPEC128, ISPEC128),
makePair(BSPEC128, ISPEC128, true),
makePair(BSPEC128, FSPEC128),
// to X 256
makePair(BSPEC128, SSPEC256),
makePair(BSPEC128, SSPEC256, true),
makePair(BSPEC128, ISPEC256),
makePair(BSPEC128, ISPEC256, true),
makePair(BSPEC128, LSPEC256),
makePair(BSPEC128, LSPEC256, true),
makePair(BSPEC128, FSPEC256),
makePair(BSPEC128, DSPEC256),
// to X 512
makePair(BSPEC128, SSPEC512),
makePair(BSPEC128, SSPEC512, true),
makePair(BSPEC128, ISPEC512),
makePair(BSPEC128, ISPEC512, true),
makePair(BSPEC128, LSPEC512),
makePair(BSPEC128, LSPEC512, true),
makePair(BSPEC128, FSPEC512),
makePair(BSPEC128, DSPEC512),
// from B 256
// to X 64
makePair(BSPEC256, SSPEC64),
makePair(BSPEC256, SSPEC64, true),
// to X 128
makePair(BSPEC256, SSPEC128),
makePair(BSPEC256, SSPEC128, true),
makePair(BSPEC256, ISPEC128),
makePair(BSPEC256, ISPEC128, true),
makePair(BSPEC256, FSPEC128),
// to X 256
makePair(BSPEC256, SSPEC256),
makePair(BSPEC256, SSPEC256, true),
makePair(BSPEC256, ISPEC256),
makePair(BSPEC256, ISPEC256, true),
makePair(BSPEC256, LSPEC256),
makePair(BSPEC256, LSPEC256, true),
makePair(BSPEC256, FSPEC256),
makePair(BSPEC256, DSPEC256),
// to X 512
makePair(BSPEC256, SSPEC512),
makePair(BSPEC256, SSPEC512, true),
makePair(BSPEC256, ISPEC512),
makePair(BSPEC256, ISPEC512, true),
makePair(BSPEC256, LSPEC512),
makePair(BSPEC256, LSPEC512, true),
makePair(BSPEC256, FSPEC512),
makePair(BSPEC256, DSPEC512),
// ====== from S ======
// from S 64
// to X 64
makePair(SSPEC64, BSPEC64),
// to X 128
makePair(SSPEC64, BSPEC128),
makePair(SSPEC64, ISPEC128),
makePair(SSPEC64, ISPEC128, true),
makePair(SSPEC64, FSPEC128),
// to X 256
makePair(SSPEC64, BSPEC256),
makePair(SSPEC64, ISPEC256),
makePair(SSPEC64, ISPEC256, true),
makePair(SSPEC64, LSPEC256),
makePair(SSPEC64, LSPEC256, true),
makePair(SSPEC64, FSPEC256),
makePair(SSPEC64, DSPEC256),
// to X 512
makePair(SSPEC64, BSPEC512),
makePair(SSPEC64, ISPEC512),
makePair(SSPEC64, ISPEC512, true),
makePair(SSPEC64, LSPEC512),
makePair(SSPEC64, LSPEC512, true),
makePair(SSPEC64, FSPEC512),
makePair(SSPEC64, DSPEC512),
// from S 128
// to X 64
makePair(SSPEC128, BSPEC64),
// to X 128
makePair(SSPEC128, BSPEC128),
makePair(SSPEC128, ISPEC128),
makePair(SSPEC128, ISPEC128, true),
makePair(SSPEC128, FSPEC128),
// to X 256
makePair(SSPEC128, BSPEC256),
makePair(SSPEC128, ISPEC256),
makePair(SSPEC128, ISPEC256, true),
makePair(SSPEC128, LSPEC256),
makePair(SSPEC128, LSPEC256, true),
makePair(SSPEC128, FSPEC256),
makePair(SSPEC128, DSPEC256),
// to X 512
makePair(SSPEC128, BSPEC512),
makePair(SSPEC128, ISPEC512),
makePair(SSPEC128, ISPEC512, true),
makePair(SSPEC128, LSPEC512),
makePair(SSPEC128, LSPEC512, true),
makePair(SSPEC128, FSPEC512),
makePair(SSPEC128, DSPEC512),
// from S 256
// to X 64
makePair(SSPEC256, BSPEC64),
// to X 128
makePair(SSPEC256, BSPEC128),
makePair(SSPEC256, ISPEC128),
makePair(SSPEC256, ISPEC128, true),
makePair(SSPEC256, FSPEC128),
// to X 256
makePair(SSPEC256, BSPEC256),
makePair(SSPEC256, ISPEC256),
makePair(SSPEC256, ISPEC256, true),
makePair(SSPEC256, LSPEC256),
makePair(SSPEC256, LSPEC256, true),
makePair(SSPEC256, FSPEC256),
makePair(SSPEC256, DSPEC256),
// to X 512
makePair(SSPEC256, BSPEC512),
makePair(SSPEC256, ISPEC512),
makePair(SSPEC256, ISPEC512, true),
makePair(SSPEC256, LSPEC512),
makePair(SSPEC256, LSPEC512, true),
makePair(SSPEC256, FSPEC512),
makePair(SSPEC256, DSPEC512),
// from S 512
// to X 64
makePair(SSPEC512, BSPEC64),
// to X 128
makePair(SSPEC512, BSPEC128),
makePair(SSPEC512, ISPEC128),
makePair(SSPEC512, ISPEC128, true),
makePair(SSPEC512, FSPEC128),
// to X 256
makePair(SSPEC512, BSPEC256),
makePair(SSPEC512, ISPEC256),
makePair(SSPEC512, ISPEC256, true),
makePair(SSPEC512, LSPEC256),
makePair(SSPEC512, LSPEC256, true),
makePair(SSPEC512, FSPEC256),
makePair(SSPEC512, DSPEC256),
// to X 512
makePair(SSPEC512, BSPEC512),
makePair(SSPEC512, ISPEC512),
makePair(SSPEC512, ISPEC512, true),
makePair(SSPEC512, LSPEC512),
makePair(SSPEC512, LSPEC512, true),
makePair(SSPEC512, FSPEC512),
makePair(SSPEC512, DSPEC512),
// ====== from I ======
// from I 64
// to X 64
makePair(ISPEC64, FSPEC64),
// to X 128
makePair(ISPEC64, LSPEC128),
makePair(ISPEC64, LSPEC128, true),
makePair(ISPEC64, FSPEC128),
makePair(ISPEC64, DSPEC128),
// from I 128
// to X 64
makePair(ISPEC128, BSPEC64),
makePair(ISPEC128, SSPEC64),
makePair(ISPEC128, FSPEC64),
// to X 128
makePair(ISPEC128, BSPEC128),
makePair(ISPEC128, SSPEC128),
makePair(ISPEC128, LSPEC128),
makePair(ISPEC128, LSPEC128, true),
makePair(ISPEC128, FSPEC128),
makePair(ISPEC128, DSPEC128),
// to X 256
makePair(ISPEC128, BSPEC256),
makePair(ISPEC128, SSPEC256),
makePair(ISPEC128, LSPEC256),
makePair(ISPEC128, LSPEC256, true),
makePair(ISPEC128, FSPEC256),
makePair(ISPEC128, DSPEC256),
// from I 256
// to X 64
makePair(ISPEC256, BSPEC64),
makePair(ISPEC256, SSPEC64),
makePair(ISPEC256, FSPEC64),
// to X 128
makePair(ISPEC256, BSPEC128),
makePair(ISPEC256, SSPEC128),
makePair(ISPEC256, LSPEC128),
makePair(ISPEC256, LSPEC128, true),
makePair(ISPEC256, FSPEC128),
makePair(ISPEC256, DSPEC128),
// to X 256
makePair(ISPEC256, BSPEC256),
makePair(ISPEC256, SSPEC256),
makePair(ISPEC256, LSPEC256),
makePair(ISPEC256, LSPEC256, true),
makePair(ISPEC256, FSPEC256),
makePair(ISPEC256, DSPEC256),
// from I 512
// to X 64
makePair(ISPEC512, BSPEC64),
makePair(ISPEC512, SSPEC64),
makePair(ISPEC512, FSPEC64),
// to X 128
makePair(ISPEC512, BSPEC128),
makePair(ISPEC512, SSPEC128),
makePair(ISPEC512, LSPEC128),
makePair(ISPEC512, LSPEC128, true),
makePair(ISPEC512, FSPEC128),
makePair(ISPEC512, DSPEC128),
// to X 256
makePair(ISPEC512, BSPEC256),
makePair(ISPEC512, SSPEC256),
makePair(ISPEC512, LSPEC256),
makePair(ISPEC512, LSPEC256, true),
makePair(ISPEC512, FSPEC256),
makePair(ISPEC512, DSPEC256),
// ====== from L ======
// from L 128
// to X 64
makePair(LSPEC128, ISPEC64),
makePair(LSPEC128, FSPEC64),
makePair(LSPEC128, DSPEC64),
// to X 128
makePair(LSPEC128, ISPEC128),
makePair(LSPEC128, FSPEC128),
makePair(LSPEC128, DSPEC128),
// to X 256
makePair(LSPEC128, ISPEC256),
makePair(LSPEC128, FSPEC256),
makePair(LSPEC128, DSPEC256),
// to X 512
makePair(LSPEC128, ISPEC512),
makePair(LSPEC128, FSPEC512),
makePair(LSPEC128, DSPEC512),
// from L 256
// to X 64
makePair(LSPEC256, BSPEC64),
makePair(LSPEC256, SSPEC64),
makePair(LSPEC256, ISPEC64),
makePair(LSPEC256, FSPEC64),
// to X 128
makePair(LSPEC256, BSPEC128),
makePair(LSPEC256, SSPEC128),
makePair(LSPEC256, ISPEC128),
makePair(LSPEC256, FSPEC128),
makePair(LSPEC256, DSPEC128),
// to X 256
makePair(LSPEC256, BSPEC256),
makePair(LSPEC256, SSPEC256),
makePair(LSPEC256, ISPEC256),
makePair(LSPEC256, FSPEC256),
makePair(LSPEC256, DSPEC256),
// to X 512
makePair(LSPEC256, BSPEC512),
makePair(LSPEC256, SSPEC512),
makePair(LSPEC256, ISPEC512),
makePair(LSPEC256, FSPEC512),
makePair(LSPEC256, DSPEC512),
// from L 512
// to X 64
makePair(LSPEC512, BSPEC64),
makePair(LSPEC512, SSPEC64),
makePair(LSPEC512, ISPEC64),
makePair(LSPEC512, FSPEC64),
// to X 128
makePair(LSPEC512, BSPEC128),
makePair(LSPEC512, SSPEC128),
makePair(LSPEC512, ISPEC128),
makePair(LSPEC512, FSPEC128),
makePair(LSPEC512, DSPEC128),
// to X 256
makePair(LSPEC512, BSPEC256),
makePair(LSPEC512, SSPEC256),
makePair(LSPEC512, ISPEC256),
makePair(LSPEC512, FSPEC256),
makePair(LSPEC512, DSPEC256),
// to X 512
makePair(LSPEC512, BSPEC512),
makePair(LSPEC512, SSPEC512),
makePair(LSPEC512, ISPEC512),
makePair(LSPEC512, FSPEC512),
makePair(LSPEC512, DSPEC512),
// ====== from F ======
// from F 64
// to X 64
makePair(FSPEC64, ISPEC64),
// to X 128
makePair(FSPEC64, ISPEC128),
makePair(FSPEC64, LSPEC128),
makePair(FSPEC64, DSPEC128),
// from F 128
// to X 64
makePair(FSPEC128, BSPEC64),
makePair(FSPEC128, SSPEC64),
makePair(FSPEC128, ISPEC64),
// to X 128
makePair(FSPEC128, BSPEC128),
makePair(FSPEC128, SSPEC128),
makePair(FSPEC128, ISPEC128),
makePair(FSPEC128, LSPEC128),
makePair(FSPEC128, DSPEC128),
// to X 256
makePair(FSPEC128, BSPEC256),
makePair(FSPEC128, SSPEC256),
makePair(FSPEC128, ISPEC256),
makePair(FSPEC128, LSPEC256),
makePair(FSPEC128, DSPEC256),
// from F 256
// to X 64
makePair(FSPEC256, BSPEC64),
makePair(FSPEC256, SSPEC64),
makePair(FSPEC256, ISPEC64),
// to X 128
makePair(FSPEC256, BSPEC128),
makePair(FSPEC256, SSPEC128),
makePair(FSPEC256, ISPEC128),
makePair(FSPEC256, LSPEC128),
makePair(FSPEC256, DSPEC128),
// to X 256
makePair(FSPEC256, BSPEC256),
makePair(FSPEC256, SSPEC256),
makePair(FSPEC256, ISPEC256),
makePair(FSPEC256, LSPEC256),
makePair(FSPEC256, DSPEC256),
// from F 512
// to X 64
makePair(FSPEC512, BSPEC64),
makePair(FSPEC512, SSPEC64),
makePair(FSPEC512, ISPEC64),
// to X 128
makePair(FSPEC512, BSPEC128),
makePair(FSPEC512, SSPEC128),
makePair(FSPEC512, ISPEC128),
makePair(FSPEC512, LSPEC128),
makePair(FSPEC512, DSPEC128),
// to X 256
makePair(FSPEC512, BSPEC256),
makePair(FSPEC512, SSPEC256),
makePair(FSPEC512, ISPEC256),
makePair(FSPEC512, LSPEC256),
makePair(FSPEC512, DSPEC256),
// ====== from D ======
// from D 128
// to X 64
makePair(DSPEC128, ISPEC64),
makePair(DSPEC128, LSPEC64),
makePair(DSPEC128, FSPEC64),
// to X 128
makePair(DSPEC128, ISPEC128),
makePair(DSPEC128, LSPEC128),
makePair(DSPEC128, FSPEC128),
// to X 256
makePair(DSPEC128, ISPEC256),
makePair(DSPEC128, LSPEC256),
makePair(DSPEC128, FSPEC256),
// to X 512
makePair(DSPEC128, ISPEC512),
makePair(DSPEC128, LSPEC512),
makePair(DSPEC128, FSPEC512),
// from D 256
// to X 64
makePair(DSPEC256, BSPEC64),
makePair(DSPEC256, SSPEC64),
makePair(DSPEC256, ISPEC64),
makePair(DSPEC256, LSPEC64),
makePair(DSPEC256, FSPEC64),
// to X 128
makePair(DSPEC256, BSPEC128),
makePair(DSPEC256, SSPEC128),
makePair(DSPEC256, ISPEC128),
makePair(DSPEC256, LSPEC128),
makePair(DSPEC256, FSPEC128),
// to X 256
makePair(DSPEC256, BSPEC256),
makePair(DSPEC256, SSPEC256),
makePair(DSPEC256, ISPEC256),
makePair(DSPEC256, LSPEC256),
makePair(DSPEC256, FSPEC256),
// to X 512
makePair(DSPEC256, BSPEC512),
makePair(DSPEC256, SSPEC512),
makePair(DSPEC256, ISPEC512),
makePair(DSPEC256, LSPEC512),
makePair(DSPEC256, FSPEC512),
// from D 512
// to X 64
makePair(DSPEC512, BSPEC64),
makePair(DSPEC512, SSPEC64),
makePair(DSPEC512, ISPEC64),
makePair(DSPEC512, LSPEC64),
makePair(DSPEC512, FSPEC64),
// to X 128
makePair(DSPEC512, BSPEC128),
makePair(DSPEC512, SSPEC128),
makePair(DSPEC512, ISPEC128),
makePair(DSPEC512, LSPEC128),
makePair(DSPEC512, FSPEC128),
// to X 256
makePair(DSPEC512, BSPEC256),
makePair(DSPEC512, SSPEC256),
makePair(DSPEC512, ISPEC256),
makePair(DSPEC512, LSPEC256),
makePair(DSPEC512, FSPEC256),
// to X 512
makePair(DSPEC512, BSPEC512),
makePair(DSPEC512, SSPEC512),
makePair(DSPEC512, ISPEC512),
makePair(DSPEC512, LSPEC512),
makePair(DSPEC512, FSPEC512)
);
public static final List<VectorSpeciesPair> AVX1_CAST_TESTS = List.of(
makePair(BSPEC64, SSPEC64),
makePair(BSPEC64, SSPEC128),