mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
Refactoring and cleanups
This commit is contained in:
parent
fe7075ee77
commit
72d1556877
@ -142,8 +142,8 @@ class VectorSupport : AllStatic {
|
||||
MODE_BITS_COERCED_LONG_TO_MASK = 1
|
||||
};
|
||||
|
||||
static int vop2ideal(jint vop, BasicType bt);
|
||||
static const char* lanetype2name(int lane_type);
|
||||
static int vop2ideal(jint vop, BasicType lane_type);
|
||||
static bool has_scalar_op(jint id);
|
||||
static bool is_unsigned_op(jint id);
|
||||
|
||||
|
||||
@ -803,7 +803,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
case VECTOR_OP_LOG10: return (v0, m) ->
|
||||
v0.uOp(m, (i, a) -> (float) Math.log10(a));
|
||||
case VECTOR_OP_SQRT: return (v0, m) ->
|
||||
v0.sOp(m, (i, a) -> (short) float16ToShortBits(Float16.sqrt(shortBitsToFloat16(a))));
|
||||
v0.sOp(m, (i, a) -> (short) float16ToRawShortBits(Float16.sqrt(shortBitsToFloat16(a))));
|
||||
case VECTOR_OP_CBRT: return (v0, m) ->
|
||||
v0.uOp(m, (i, a) -> (float) Math.cbrt(a));
|
||||
case VECTOR_OP_SINH: return (v0, m) ->
|
||||
@ -1004,7 +1004,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
public final
|
||||
Float16Vector lanewise(VectorOperators.Binary op,
|
||||
long e) {
|
||||
short e1 = float16ToShortBits(Float16.valueOf(e));
|
||||
short e1 = float16ToRawShortBits(Float16.valueOf(e));
|
||||
if (shortBitsToFloat16(e1).longValue() != e) {
|
||||
vspecies().checkValue(e); // for exception
|
||||
}
|
||||
@ -1025,7 +1025,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
public final
|
||||
Float16Vector lanewise(VectorOperators.Binary op,
|
||||
long e, VectorMask<Float16> m) {
|
||||
short e1 = float16ToShortBits(Float16.valueOf(e));
|
||||
short e1 = float16ToRawShortBits(Float16.valueOf(e));
|
||||
if (shortBitsToFloat16(e1).longValue() != e) {
|
||||
vspecies().checkValue(e); // for exception
|
||||
}
|
||||
@ -1118,7 +1118,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
private static TernaryOperation<Float16Vector, VectorMask<Float16>> ternaryOperations(int opc_) {
|
||||
switch (opc_) {
|
||||
case VECTOR_OP_FMA: return (v0, v1_, v2_, m) ->
|
||||
v0.tOp(v1_, v2_, m, (i, a, b, c) -> float16ToShortBits(Float16.fma(shortBitsToFloat16(a), shortBitsToFloat16(b), shortBitsToFloat16(c))));
|
||||
v0.tOp(v1_, v2_, m, (i, a, b, c) -> float16ToRawShortBits(Float16.fma(shortBitsToFloat16(a), shortBitsToFloat16(b), shortBitsToFloat16(c))));
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
@ -1895,7 +1895,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
// first kill the sign:
|
||||
bits = bits.and(Short.MAX_VALUE);
|
||||
// next find the bit pattern for infinity:
|
||||
short infbits = (short) toBits(float16ToShortBits(Float16.POSITIVE_INFINITY));
|
||||
short infbits = (short) toBits(float16ToRawShortBits(Float16.POSITIVE_INFINITY));
|
||||
// now compare:
|
||||
if (op == IS_FINITE) {
|
||||
m = bits.compare(LT, infbits);
|
||||
@ -1943,7 +1943,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
// first kill the sign:
|
||||
bits = bits.and(Short.MAX_VALUE);
|
||||
// next find the bit pattern for infinity:
|
||||
short infbits = (short) toBits(float16ToShortBits(Float16.POSITIVE_INFINITY));
|
||||
short infbits = (short) toBits(float16ToRawShortBits(Float16.POSITIVE_INFINITY));
|
||||
// now compare:
|
||||
if (op == IS_FINITE) {
|
||||
m = bits.compare(LT, infbits, m);
|
||||
@ -2153,7 +2153,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
// and multiply.
|
||||
Float16Vector iota = s.iota();
|
||||
short sc = (short) scale_;
|
||||
return v.add(sc == 1 ? iota : iota.mul(float16ToShortBits(Float16.valueOf(sc))));
|
||||
return v.add(sc == 1 ? iota : iota.mul(float16ToRawShortBits(Float16.valueOf(sc))));
|
||||
});
|
||||
}
|
||||
|
||||
@ -2753,8 +2753,8 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
}
|
||||
|
||||
|
||||
private static final short MIN_OR_INF = float16ToShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MAX_OR_INF = float16ToShortBits(Float16.POSITIVE_INFINITY);
|
||||
private static final short MIN_OR_INF = float16ToRawShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MAX_OR_INF = float16ToRawShortBits(Float16.POSITIVE_INFINITY);
|
||||
|
||||
public @Override abstract long reduceLanesToLong(VectorOperators.Associative op);
|
||||
public @Override abstract long reduceLanesToLong(VectorOperators.Associative op,
|
||||
@ -2826,7 +2826,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
short[] a = toArray();
|
||||
int[] res = new int[a.length];
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
short e = a[i];
|
||||
float e = shortBitsToFloat16(a[i]).floatValue();
|
||||
res[i] = (int) Float16Species.toIntegralChecked(e, true);
|
||||
}
|
||||
return res;
|
||||
@ -2840,7 +2840,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
short[] a = toArray();
|
||||
long[] res = new long[a.length];
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
short e = shortBitsToFloat16(a[i]).shortValue();
|
||||
float e = shortBitsToFloat16(a[i]).floatValue();
|
||||
res[i] = Float16Species.toIntegralChecked(e, false);
|
||||
}
|
||||
return res;
|
||||
@ -4140,7 +4140,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
@ForceInline
|
||||
long longToElementBits(long value) {
|
||||
// Do the conversion, and then test it for failure.
|
||||
short e = float16ToShortBits(Float16.valueOf(value));
|
||||
short e = float16ToRawShortBits(Float16.valueOf(value));
|
||||
if (shortBitsToFloat16(e).longValue() != value) {
|
||||
throw badElementBits(value, e);
|
||||
}
|
||||
@ -4149,7 +4149,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static long toIntegralChecked(short e, boolean convertToInt) {
|
||||
static long toIntegralChecked(float e, boolean convertToInt) {
|
||||
long value = convertToInt ? (int) e : (long) e;
|
||||
if ((short) value != e) {
|
||||
throw badArrayBits(e, convertToInt, value);
|
||||
@ -4165,7 +4165,7 @@ public abstract class Float16Vector extends AbstractVector<Float16> {
|
||||
short[] va = new short[laneCount()];
|
||||
for (int i = 0; i < va.length; i++) {
|
||||
int lv = values[i];
|
||||
short v = float16ToShortBits(Float16.valueOf(lv));
|
||||
short v = float16ToRawShortBits(Float16.valueOf(lv));
|
||||
va[i] = v;
|
||||
if (Float16.valueOf(lv).intValue() != lv) {
|
||||
throw badElementBits(lv, v);
|
||||
|
||||
@ -701,7 +701,7 @@ final class Float16Vector128 extends Float16Vector {
|
||||
return (Float16Mask128)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS,
|
||||
Float16Vector128.class, Float16Mask128.class, T_FLOAT16, VLENGTH, null, this,
|
||||
(v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT,
|
||||
Float16.float16ToShortBits(Float16.valueOf(m1.trueCount()))));
|
||||
Float16.float16ToRawShortBits(Float16.valueOf(m1.trueCount()))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -717,7 +717,7 @@ final class Float16Vector256 extends Float16Vector {
|
||||
return (Float16Mask256)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS,
|
||||
Float16Vector256.class, Float16Mask256.class, T_FLOAT16, VLENGTH, null, this,
|
||||
(v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT,
|
||||
Float16.float16ToShortBits(Float16.valueOf(m1.trueCount()))));
|
||||
Float16.float16ToRawShortBits(Float16.valueOf(m1.trueCount()))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -749,7 +749,7 @@ final class Float16Vector512 extends Float16Vector {
|
||||
return (Float16Mask512)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS,
|
||||
Float16Vector512.class, Float16Mask512.class, T_FLOAT16, VLENGTH, null, this,
|
||||
(v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT,
|
||||
Float16.float16ToShortBits(Float16.valueOf(m1.trueCount()))));
|
||||
Float16.float16ToRawShortBits(Float16.valueOf(m1.trueCount()))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -693,7 +693,7 @@ final class Float16Vector64 extends Float16Vector {
|
||||
return (Float16Mask64)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS,
|
||||
Float16Vector64.class, Float16Mask64.class, T_FLOAT16, VLENGTH, null, this,
|
||||
(v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT,
|
||||
Float16.float16ToShortBits(Float16.valueOf(m1.trueCount()))));
|
||||
Float16.float16ToRawShortBits(Float16.valueOf(m1.trueCount()))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -686,7 +686,7 @@ final class Float16VectorMax extends Float16Vector {
|
||||
return (Float16MaskMax)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS,
|
||||
Float16VectorMax.class, Float16MaskMax.class, T_FLOAT16, VLENGTH, null, this,
|
||||
(v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT,
|
||||
Float16.float16ToShortBits(Float16.valueOf(m1.trueCount()))));
|
||||
Float16.float16ToRawShortBits(Float16.valueOf(m1.trueCount()))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -28,8 +28,6 @@ import jdk.internal.misc.Unsafe;
|
||||
import jdk.internal.vm.annotation.ForceInline;
|
||||
import jdk.internal.vm.vector.VectorSupport;
|
||||
|
||||
import static jdk.internal.vm.vector.VectorSupport.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -209,8 +207,8 @@ public abstract class VectorMask<E> extends jdk.internal.vm.vector.VectorSupport
|
||||
int laneCount = vsp.laneCount();
|
||||
offset = VectorIntrinsics.checkFromIndexSize(offset, laneCount, bits.length);
|
||||
return VectorSupport.load(
|
||||
vsp.maskType(), vsp.laneBasicType(), laneCount, bits,
|
||||
(long) offset + Unsafe.ARRAY_BOOLEAN_BASE_OFFSET, false,
|
||||
vsp.maskType(), vsp.laneBasicType(), laneCount,
|
||||
bits, (long) offset + Unsafe.ARRAY_BOOLEAN_BASE_OFFSET, false,
|
||||
bits, offset, vsp,
|
||||
(c, idx, s)
|
||||
-> s.opm(n -> c[((int)idx) + n]));
|
||||
@ -242,8 +240,7 @@ public abstract class VectorMask<E> extends jdk.internal.vm.vector.VectorSupport
|
||||
public static <E> VectorMask<E> fromLong(VectorSpecies<E> species, long bits) {
|
||||
AbstractSpecies<E> vsp = (AbstractSpecies<E>) species;
|
||||
bits = bits & (0xFFFFFFFFFFFFFFFFL >>> (64 - vsp.laneCount()));
|
||||
return VectorSupport.fromBitsCoerced(vsp.maskType(), vsp.laneBasicType(),
|
||||
vsp.laneCount(), bits,
|
||||
return VectorSupport.fromBitsCoerced(vsp.maskType(), vsp.laneBasicType(), vsp.laneCount(), bits,
|
||||
VectorSupport.MODE_BITS_COERCED_LONG_TO_MASK, vsp,
|
||||
(m, s) -> {
|
||||
if (m == (m >> 1)) {
|
||||
|
||||
@ -922,7 +922,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
v0.uOp(m, (i, a) -> ($fallbacktype$) Math.log10(a));
|
||||
case VECTOR_OP_SQRT: return (v0, m) ->
|
||||
#if[FP16]
|
||||
v0.sOp(m, (i, a) -> ($type$) float16ToShortBits(Float16.sqrt(shortBitsToFloat16(a))));
|
||||
v0.sOp(m, (i, a) -> ($type$) float16ToRawShortBits(Float16.sqrt(shortBitsToFloat16(a))));
|
||||
#else[FP16]
|
||||
v0.uOp(m, (i, a) -> ($fallbacktype$) Math.sqrt(a));
|
||||
#end[FP16]
|
||||
@ -1238,7 +1238,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
public final
|
||||
$abstractvectortype$ lanewise(VectorOperators.Binary op,
|
||||
long e) {
|
||||
$type$ e1 = {#if[FP16]?float16ToShortBits(Float16.valueOf(e)):($type$) e};
|
||||
$type$ e1 = {#if[FP16]?float16ToRawShortBits(Float16.valueOf(e)):($type$) e};
|
||||
#if[BITWISE]
|
||||
if ((long)e1 != e
|
||||
// allow shift ops to clip down their int parameters
|
||||
@ -1265,7 +1265,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
public final
|
||||
$abstractvectortype$ lanewise(VectorOperators.Binary op,
|
||||
long e, VectorMask<$Boxtype$> m) {
|
||||
$type$ e1 = {#if[FP16]?float16ToShortBits(Float16.valueOf(e)):($type$) e};
|
||||
$type$ e1 = {#if[FP16]?float16ToRawShortBits(Float16.valueOf(e)):($type$) e};
|
||||
#if[BITWISE]
|
||||
if ((long)e1 != e
|
||||
// allow shift ops to clip down their int parameters
|
||||
@ -1455,7 +1455,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
#if[FP]
|
||||
case VECTOR_OP_FMA: return (v0, v1_, v2_, m) ->
|
||||
#if[FP16]
|
||||
v0.tOp(v1_, v2_, m, (i, a, b, c) -> float16ToShortBits(Float16.fma(shortBitsToFloat16(a), shortBitsToFloat16(b), shortBitsToFloat16(c))));
|
||||
v0.tOp(v1_, v2_, m, (i, a, b, c) -> float16ToRawShortBits(Float16.fma(shortBitsToFloat16(a), shortBitsToFloat16(b), shortBitsToFloat16(c))));
|
||||
#else[FP16]
|
||||
v0.tOp(v1_, v2_, m, (i, a, b, c) -> Math.fma(a, b, c));
|
||||
#end[FP16]
|
||||
@ -2487,7 +2487,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
// first kill the sign:
|
||||
bits = bits.and($Boxbitstype$.MAX_VALUE);
|
||||
// next find the bit pattern for infinity:
|
||||
$bitstype$ infbits = ($bitstype$) toBits({#if[FP16]?float16ToShortBits($Boxtype$.POSITIVE_INFINITY):$Boxtype$.POSITIVE_INFINITY});
|
||||
$bitstype$ infbits = ($bitstype$) toBits({#if[FP16]?float16ToRawShortBits($Boxtype$.POSITIVE_INFINITY):$Boxtype$.POSITIVE_INFINITY});
|
||||
// now compare:
|
||||
if (op == IS_FINITE) {
|
||||
m = bits.compare(LT, infbits);
|
||||
@ -2541,7 +2541,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
// first kill the sign:
|
||||
bits = bits.and($Boxbitstype$.MAX_VALUE);
|
||||
// next find the bit pattern for infinity:
|
||||
$bitstype$ infbits = ($bitstype$) toBits({#if[FP16]?float16ToShortBits($Boxtype$.POSITIVE_INFINITY):$Boxtype$.POSITIVE_INFINITY});
|
||||
$bitstype$ infbits = ($bitstype$) toBits({#if[FP16]?float16ToRawShortBits($Boxtype$.POSITIVE_INFINITY):$Boxtype$.POSITIVE_INFINITY});
|
||||
// now compare:
|
||||
if (op == IS_FINITE) {
|
||||
m = bits.compare(LT, infbits, m);
|
||||
@ -2769,7 +2769,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
// and multiply.
|
||||
$abstractvectortype$ iota = s.iota();
|
||||
$type$ sc = ($type$) scale_;
|
||||
return v.add(sc == 1 ? iota : iota.mul({#if[FP16]?float16ToShortBits(Float16.valueOf(sc)):sc}));
|
||||
return v.add(sc == 1 ? iota : iota.mul({#if[FP16]?float16ToRawShortBits(Float16.valueOf(sc)):sc}));
|
||||
});
|
||||
}
|
||||
|
||||
@ -3580,8 +3580,8 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
|
||||
|
||||
#if[FP]
|
||||
private static final $type$ MIN_OR_INF = {#if[FP16]?float16ToShortBits($Boxtype$.NEGATIVE_INFINITY):$Boxtype$.NEGATIVE_INFINITY};
|
||||
private static final $type$ MAX_OR_INF = {#if[FP16]?float16ToShortBits($Boxtype$.POSITIVE_INFINITY):$Boxtype$.POSITIVE_INFINITY};
|
||||
private static final $type$ MIN_OR_INF = {#if[FP16]?float16ToRawShortBits($Boxtype$.NEGATIVE_INFINITY):$Boxtype$.NEGATIVE_INFINITY};
|
||||
private static final $type$ MAX_OR_INF = {#if[FP16]?float16ToRawShortBits($Boxtype$.POSITIVE_INFINITY):$Boxtype$.POSITIVE_INFINITY};
|
||||
#else[FP]
|
||||
private static final $type$ MIN_OR_INF = $Boxtype$.MIN_VALUE;
|
||||
private static final $type$ MAX_OR_INF = $Boxtype$.MAX_VALUE;
|
||||
@ -3683,7 +3683,11 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
$type$[] a = toArray();
|
||||
int[] res = new int[a.length];
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
#if[FP16]
|
||||
float e = shortBitsToFloat16(a[i]).floatValue();
|
||||
#else[FP16]
|
||||
$type$ e = a[i];
|
||||
#end[FP16]
|
||||
res[i] = (int) $Type$Species.toIntegralChecked(e, true);
|
||||
}
|
||||
return res;
|
||||
@ -3720,7 +3724,11 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
$type$[] a = toArray();
|
||||
long[] res = new long[a.length];
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
$type$ e = {#if[FP16]?shortBitsToFloat16(a[i]).shortValue():a[i]};
|
||||
#if[FP16]
|
||||
float e = shortBitsToFloat16(a[i]).floatValue();
|
||||
#else[FP16]
|
||||
$type$ e = a[i];
|
||||
#end[FP16]
|
||||
res[i] = $Type$Species.toIntegralChecked(e, false);
|
||||
}
|
||||
return res;
|
||||
@ -5761,7 +5769,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
return value;
|
||||
#else[long]
|
||||
// Do the conversion, and then test it for failure.
|
||||
$type$ e = {#if[FP16]?float16ToShortBits(Float16.valueOf(value)):($type$) value};
|
||||
$type$ e = {#if[FP16]?float16ToRawShortBits(Float16.valueOf(value)):($type$) value};
|
||||
if ({#if[FP16]?shortBitsToFloat16(e).longValue():(long) e} != value) {
|
||||
throw badElementBits(value, e);
|
||||
}
|
||||
@ -5771,7 +5779,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static long toIntegralChecked($type$ e, boolean convertToInt) {
|
||||
static long toIntegralChecked({#if[FP16]?float:$type$} e, boolean convertToInt) {
|
||||
long value = convertToInt ? (int) e : (long) e;
|
||||
if (($type$) value != e) {
|
||||
throw badArrayBits(e, convertToInt, value);
|
||||
@ -5788,7 +5796,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
for (int i = 0; i < va.length; i++) {
|
||||
int lv = values[i];
|
||||
#if[FP16]
|
||||
$type$ v = float16ToShortBits(Float16.valueOf(lv));
|
||||
$type$ v = float16ToRawShortBits(Float16.valueOf(lv));
|
||||
va[i] = v;
|
||||
if (Float16.valueOf(lv).intValue() != lv) {
|
||||
throw badElementBits(lv, v);
|
||||
|
||||
@ -1021,7 +1021,7 @@ final class $vectortype$ extends $abstractvectortype$ {
|
||||
return ($masktype$)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS,
|
||||
$vectortype$.class, $masktype$.class, $laneType$, VLENGTH, null, this,
|
||||
(v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT,
|
||||
{#if[FP16]?Float16.float16ToShortBits(Float16.valueOf(m1.trueCount())):m1.trueCount()}));
|
||||
{#if[FP16]?Float16.float16ToRawShortBits(Float16.valueOf(m1.trueCount())):m1.trueCount()}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class ByteVector128Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static ByteVector bcast_vec = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
static void AssertEquals(byte actual, byte expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3193,6 +3191,8 @@ public class ByteVector128Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static ByteVector bv_MIN = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void MINByteVector128TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3201,13 +3201,15 @@ public class ByteVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static ByteVector bv_min = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void minByteVector128TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3216,13 +3218,15 @@ public class ByteVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector128Tests::min);
|
||||
}
|
||||
|
||||
static ByteVector bv_MIN_M = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpMaskProvider")
|
||||
static void MINByteVector128TestsMaskedWithMemOp(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3233,13 +3237,15 @@ public class ByteVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, mask, ByteVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static ByteVector bv_MAX = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void MAXByteVector128TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3248,13 +3254,15 @@ public class ByteVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector128Tests::MAX);
|
||||
}
|
||||
|
||||
static ByteVector bv_max = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void maxByteVector128TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3263,13 +3271,15 @@ public class ByteVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector128Tests::max);
|
||||
}
|
||||
|
||||
static ByteVector bv_MAX_M = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpMaskProvider")
|
||||
static void MAXByteVector128TestsMaskedWithMemOp(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3280,7 +3290,7 @@ public class ByteVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class ByteVector256Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static ByteVector bcast_vec = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
static void AssertEquals(byte actual, byte expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3193,6 +3191,8 @@ public class ByteVector256Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static ByteVector bv_MIN = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void MINByteVector256TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3201,13 +3201,15 @@ public class ByteVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static ByteVector bv_min = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void minByteVector256TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3216,13 +3218,15 @@ public class ByteVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector256Tests::min);
|
||||
}
|
||||
|
||||
static ByteVector bv_MIN_M = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpMaskProvider")
|
||||
static void MINByteVector256TestsMaskedWithMemOp(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3233,13 +3237,15 @@ public class ByteVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, mask, ByteVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static ByteVector bv_MAX = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void MAXByteVector256TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3248,13 +3254,15 @@ public class ByteVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector256Tests::MAX);
|
||||
}
|
||||
|
||||
static ByteVector bv_max = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void maxByteVector256TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3263,13 +3271,15 @@ public class ByteVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector256Tests::max);
|
||||
}
|
||||
|
||||
static ByteVector bv_MAX_M = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpMaskProvider")
|
||||
static void MAXByteVector256TestsMaskedWithMemOp(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3280,7 +3290,7 @@ public class ByteVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class ByteVector512Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static ByteVector bcast_vec = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
static void AssertEquals(byte actual, byte expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3193,6 +3191,8 @@ public class ByteVector512Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static ByteVector bv_MIN = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void MINByteVector512TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3201,13 +3201,15 @@ public class ByteVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static ByteVector bv_min = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void minByteVector512TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3216,13 +3218,15 @@ public class ByteVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector512Tests::min);
|
||||
}
|
||||
|
||||
static ByteVector bv_MIN_M = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpMaskProvider")
|
||||
static void MINByteVector512TestsMaskedWithMemOp(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3233,13 +3237,15 @@ public class ByteVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, mask, ByteVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static ByteVector bv_MAX = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void MAXByteVector512TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3248,13 +3254,15 @@ public class ByteVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector512Tests::MAX);
|
||||
}
|
||||
|
||||
static ByteVector bv_max = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void maxByteVector512TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3263,13 +3271,15 @@ public class ByteVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector512Tests::max);
|
||||
}
|
||||
|
||||
static ByteVector bv_MAX_M = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpMaskProvider")
|
||||
static void MAXByteVector512TestsMaskedWithMemOp(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3280,7 +3290,7 @@ public class ByteVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class ByteVector64Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static ByteVector bcast_vec = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
static void AssertEquals(byte actual, byte expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3193,6 +3191,8 @@ public class ByteVector64Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static ByteVector bv_MIN = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void MINByteVector64TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3201,13 +3201,15 @@ public class ByteVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static ByteVector bv_min = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void minByteVector64TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3216,13 +3218,15 @@ public class ByteVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector64Tests::min);
|
||||
}
|
||||
|
||||
static ByteVector bv_MIN_M = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpMaskProvider")
|
||||
static void MINByteVector64TestsMaskedWithMemOp(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3233,13 +3237,15 @@ public class ByteVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, mask, ByteVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static ByteVector bv_MAX = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void MAXByteVector64TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3248,13 +3254,15 @@ public class ByteVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector64Tests::MAX);
|
||||
}
|
||||
|
||||
static ByteVector bv_max = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void maxByteVector64TestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3263,13 +3271,15 @@ public class ByteVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVector64Tests::max);
|
||||
}
|
||||
|
||||
static ByteVector bv_MAX_M = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpMaskProvider")
|
||||
static void MAXByteVector64TestsMaskedWithMemOp(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3280,7 +3290,7 @@ public class ByteVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class ByteVectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static ByteVector bcast_vec = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
static void AssertEquals(byte actual, byte expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3199,6 +3197,8 @@ public class ByteVectorMaxTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static ByteVector bv_MIN = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void MINByteVectorMaxTestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3207,13 +3207,15 @@ public class ByteVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static ByteVector bv_min = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void minByteVectorMaxTestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3222,13 +3224,15 @@ public class ByteVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVectorMaxTests::min);
|
||||
}
|
||||
|
||||
static ByteVector bv_MIN_M = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpMaskProvider")
|
||||
static void MINByteVectorMaxTestsMaskedWithMemOp(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3239,13 +3243,15 @@ public class ByteVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, mask, ByteVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static ByteVector bv_MAX = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void MAXByteVectorMaxTestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3254,13 +3260,15 @@ public class ByteVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVectorMaxTests::MAX);
|
||||
}
|
||||
|
||||
static ByteVector bv_max = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpProvider")
|
||||
static void maxByteVectorMaxTestsWithMemOp(IntFunction<byte[]> fa) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3269,13 +3277,15 @@ public class ByteVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (byte)10, ByteVectorMaxTests::max);
|
||||
}
|
||||
|
||||
static ByteVector bv_MAX_M = ByteVector.broadcast(SPECIES, (byte)10);
|
||||
|
||||
@Test(dataProvider = "byteUnaryOpMaskProvider")
|
||||
static void MAXByteVectorMaxTestsMaskedWithMemOp(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
@ -3286,7 +3296,7 @@ public class ByteVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,8 +62,6 @@ public class DoubleVector128Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static DoubleVector bcast_vec = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
static void AssertEquals(double actual, double expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -2397,6 +2395,8 @@ public class DoubleVector128Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector128Tests::ADD);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MIN = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void MINDoubleVector128TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2405,13 +2405,15 @@ public class DoubleVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static DoubleVector bv_min = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void minDoubleVector128TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2420,13 +2422,15 @@ public class DoubleVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector128Tests::min);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MIN_M = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpMaskProvider")
|
||||
static void MINDoubleVector128TestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2437,13 +2441,15 @@ public class DoubleVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, mask, DoubleVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MAX = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void MAXDoubleVector128TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2452,13 +2458,15 @@ public class DoubleVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector128Tests::MAX);
|
||||
}
|
||||
|
||||
static DoubleVector bv_max = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void maxDoubleVector128TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2467,13 +2475,15 @@ public class DoubleVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector128Tests::max);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MAX_M = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpMaskProvider")
|
||||
static void MAXDoubleVector128TestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,7 +2494,7 @@ public class DoubleVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,8 +62,6 @@ public class DoubleVector256Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static DoubleVector bcast_vec = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
static void AssertEquals(double actual, double expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -2397,6 +2395,8 @@ public class DoubleVector256Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector256Tests::ADD);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MIN = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void MINDoubleVector256TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2405,13 +2405,15 @@ public class DoubleVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static DoubleVector bv_min = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void minDoubleVector256TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2420,13 +2422,15 @@ public class DoubleVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector256Tests::min);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MIN_M = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpMaskProvider")
|
||||
static void MINDoubleVector256TestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2437,13 +2441,15 @@ public class DoubleVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, mask, DoubleVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MAX = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void MAXDoubleVector256TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2452,13 +2458,15 @@ public class DoubleVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector256Tests::MAX);
|
||||
}
|
||||
|
||||
static DoubleVector bv_max = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void maxDoubleVector256TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2467,13 +2475,15 @@ public class DoubleVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector256Tests::max);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MAX_M = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpMaskProvider")
|
||||
static void MAXDoubleVector256TestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,7 +2494,7 @@ public class DoubleVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,8 +62,6 @@ public class DoubleVector512Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static DoubleVector bcast_vec = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
static void AssertEquals(double actual, double expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -2397,6 +2395,8 @@ public class DoubleVector512Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector512Tests::ADD);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MIN = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void MINDoubleVector512TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2405,13 +2405,15 @@ public class DoubleVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static DoubleVector bv_min = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void minDoubleVector512TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2420,13 +2422,15 @@ public class DoubleVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector512Tests::min);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MIN_M = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpMaskProvider")
|
||||
static void MINDoubleVector512TestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2437,13 +2441,15 @@ public class DoubleVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, mask, DoubleVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MAX = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void MAXDoubleVector512TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2452,13 +2458,15 @@ public class DoubleVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector512Tests::MAX);
|
||||
}
|
||||
|
||||
static DoubleVector bv_max = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void maxDoubleVector512TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2467,13 +2475,15 @@ public class DoubleVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector512Tests::max);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MAX_M = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpMaskProvider")
|
||||
static void MAXDoubleVector512TestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,7 +2494,7 @@ public class DoubleVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,8 +62,6 @@ public class DoubleVector64Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static DoubleVector bcast_vec = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
static void AssertEquals(double actual, double expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -2397,6 +2395,8 @@ public class DoubleVector64Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector64Tests::ADD);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MIN = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void MINDoubleVector64TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2405,13 +2405,15 @@ public class DoubleVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static DoubleVector bv_min = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void minDoubleVector64TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2420,13 +2422,15 @@ public class DoubleVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector64Tests::min);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MIN_M = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpMaskProvider")
|
||||
static void MINDoubleVector64TestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2437,13 +2441,15 @@ public class DoubleVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, mask, DoubleVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MAX = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void MAXDoubleVector64TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2452,13 +2458,15 @@ public class DoubleVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector64Tests::MAX);
|
||||
}
|
||||
|
||||
static DoubleVector bv_max = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void maxDoubleVector64TestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2467,13 +2475,15 @@ public class DoubleVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVector64Tests::max);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MAX_M = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpMaskProvider")
|
||||
static void MAXDoubleVector64TestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,7 +2494,7 @@ public class DoubleVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,8 +62,6 @@ public class DoubleVectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static DoubleVector bcast_vec = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
static void AssertEquals(double actual, double expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -2403,6 +2401,8 @@ public class DoubleVectorMaxTests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVectorMaxTests::ADD);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MIN = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void MINDoubleVectorMaxTestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2411,13 +2411,15 @@ public class DoubleVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static DoubleVector bv_min = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void minDoubleVectorMaxTestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2426,13 +2428,15 @@ public class DoubleVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVectorMaxTests::min);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MIN_M = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpMaskProvider")
|
||||
static void MINDoubleVectorMaxTestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2443,13 +2447,15 @@ public class DoubleVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, mask, DoubleVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MAX = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void MAXDoubleVectorMaxTestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2458,13 +2464,15 @@ public class DoubleVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVectorMaxTests::MAX);
|
||||
}
|
||||
|
||||
static DoubleVector bv_max = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpProvider")
|
||||
static void maxDoubleVectorMaxTestsWithMemOp(IntFunction<double[]> fa) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2473,13 +2481,15 @@ public class DoubleVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (double)10, DoubleVectorMaxTests::max);
|
||||
}
|
||||
|
||||
static DoubleVector bv_MAX_M = DoubleVector.broadcast(SPECIES, (double)10);
|
||||
|
||||
@Test(dataProvider = "doubleUnaryOpMaskProvider")
|
||||
static void MAXDoubleVectorMaxTestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
|
||||
double[] a = fa.apply(SPECIES.length());
|
||||
@ -2490,7 +2500,7 @@ public class DoubleVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -64,8 +64,6 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static Float16Vector bcast_vec = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
static void AssertEquals(short actual, short expected) {
|
||||
Assert.assertEquals(Float.float16ToFloat((short)actual), Float.float16ToFloat((short)expected));
|
||||
}
|
||||
@ -119,9 +117,9 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
// Identity values for reduction operations
|
||||
private static final short ADD_IDENTITY = (short)0;
|
||||
private static final short FIRST_NONZERO_IDENTITY = (short)0;
|
||||
private static final short MAX_IDENTITY = float16ToShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MIN_IDENTITY = float16ToShortBits(Float16.POSITIVE_INFINITY);
|
||||
private static final short MUL_IDENTITY = float16ToShortBits(Float16.valueOf(1.0f));
|
||||
private static final short MAX_IDENTITY = float16ToRawShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MIN_IDENTITY = float16ToRawShortBits(Float16.POSITIVE_INFINITY);
|
||||
private static final short MUL_IDENTITY = float16ToRawShortBits(Float16.valueOf(1.0f));
|
||||
|
||||
// for floating point addition reduction ops that may introduce rounding errors
|
||||
private static final short RELATIVE_ROUNDING_ERROR_FACTOR_ADD = (short)10.0;
|
||||
@ -205,13 +203,13 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
short relativeErrorFactor) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))));
|
||||
AssertEquals(rc, fa.apply(a), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))));
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))));
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))), "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))), "at index #" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,13 +231,13 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
short relativeError) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))));
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))));
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))));
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))), "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))), "at index #" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -600,10 +598,10 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue()))));
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue()))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(r[i], f.apply(a[i], (float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())))),
|
||||
AssertEquals(r[i], f.apply(a[i], (float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())))),
|
||||
"(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i);
|
||||
}
|
||||
}
|
||||
@ -664,10 +662,10 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())), mask[i % SPECIES.length()]));
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())), mask[i % SPECIES.length()]));
|
||||
}
|
||||
} catch (AssertionError err) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())),
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())),
|
||||
mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] +
|
||||
", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " +
|
||||
mask[i % SPECIES.length()]);
|
||||
@ -1154,23 +1152,9 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
static short genValue(int i) {
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
}
|
||||
|
||||
static int intCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
return Integer.MAX_VALUE;
|
||||
case 1:
|
||||
return Integer.MIN_VALUE;
|
||||
case 2:
|
||||
return Integer.MIN_VALUE;
|
||||
case 3:
|
||||
return Integer.MAX_VALUE;
|
||||
default:
|
||||
return (int)0;
|
||||
}
|
||||
}
|
||||
|
||||
static final List<IntFunction<short[]>> INT_FLOAT16_GENERATORS = List.of(
|
||||
withToString("Float16[-i * 5]", (int s) -> {
|
||||
@ -1184,10 +1168,6 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
withToString("Float16[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (((short)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
}),
|
||||
withToString("Float16[intCornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (short)intCornerCaseValue(i));
|
||||
})
|
||||
);
|
||||
|
||||
@ -1202,23 +1182,9 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static long longCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
return Long.MAX_VALUE;
|
||||
case 1:
|
||||
return Long.MIN_VALUE;
|
||||
case 2:
|
||||
return Long.MIN_VALUE;
|
||||
case 3:
|
||||
return Long.MAX_VALUE;
|
||||
default:
|
||||
return (long)0;
|
||||
}
|
||||
}
|
||||
|
||||
static short genValue(long i) {
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
}
|
||||
|
||||
static final List<IntFunction<short[]>> LONG_FLOAT16_GENERATORS = List.of(
|
||||
@ -1233,10 +1199,6 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
withToString("Float16[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (((short)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
}),
|
||||
withToString("Float16[cornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (short)genValue(longCornerCaseValue(i)));
|
||||
})
|
||||
);
|
||||
|
||||
@ -1571,12 +1533,12 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
|
||||
static short cornerCaseValue(int i) {
|
||||
return switch(i % 8) {
|
||||
case 0 -> float16ToShortBits(Float16.MAX_VALUE);
|
||||
case 1 -> float16ToShortBits(Float16.MIN_VALUE);
|
||||
case 2 -> float16ToShortBits(Float16.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToShortBits(Float16.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToShortBits(Float16.NaN);
|
||||
case 5 -> float16ToShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 0 -> float16ToRawShortBits(Float16.MAX_VALUE);
|
||||
case 1 -> float16ToRawShortBits(Float16.MIN_VALUE);
|
||||
case 2 -> float16ToRawShortBits(Float16.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToRawShortBits(Float16.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToRawShortBits(Float16.NaN);
|
||||
case 5 -> float16ToRawShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 6 -> ((short)0.0);
|
||||
default -> ((short)-0.0);
|
||||
};
|
||||
@ -1643,211 +1605,211 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
static short scalar_add(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.add(at, bt));
|
||||
return float16ToRawShortBits(Float16.add(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_sub(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.subtract(at, bt));
|
||||
return float16ToRawShortBits(Float16.subtract(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_mul(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.multiply(at, bt));
|
||||
return float16ToRawShortBits(Float16.multiply(at, bt));
|
||||
|
||||
}
|
||||
static short scalar_max(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.max(at, bt));
|
||||
return float16ToRawShortBits(Float16.max(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_min(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.min(at, bt));
|
||||
return float16ToRawShortBits(Float16.min(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_div(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.divide(at, bt));
|
||||
return float16ToRawShortBits(Float16.divide(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_fma(short a, short b, short c) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
Float16 ct = shortBitsToFloat16(c);
|
||||
return float16ToShortBits(Float16.fma(at, bt, ct));
|
||||
return float16ToRawShortBits(Float16.fma(at, bt, ct));
|
||||
}
|
||||
|
||||
static short scalar_abs(short a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.abs(at));
|
||||
return float16ToRawShortBits(Float16.abs(at));
|
||||
}
|
||||
|
||||
static short scalar_neg(short a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.valueOf(-at.floatValue()));
|
||||
return float16ToRawShortBits(Float16.valueOf(-at.floatValue()));
|
||||
}
|
||||
|
||||
static short scalar_sin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_exp(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log1p(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log10(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_expm1(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_tan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_sinh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cosh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_tanh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_asin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_acos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_atan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cbrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_sqrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_hypot(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_pow(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_atan2(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_exp(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log1p(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log10(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_expm1(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_tan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sinh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cosh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_tanh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_asin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_acos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_atan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cbrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sqrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_hypot(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_pow(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_atan2(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
@ -1863,10 +1825,10 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
|
||||
@Test
|
||||
static void smokeTest1() {
|
||||
Float16Vector three = Float16Vector.broadcast(SPECIES, float16ToShortBits(Float16.valueOf(-3)));
|
||||
Float16Vector three = Float16Vector.broadcast(SPECIES, float16ToRawShortBits(Float16.valueOf(-3)));
|
||||
Float16Vector three2 = (Float16Vector) SPECIES.broadcast(Float16.valueOf(-3).longValue());
|
||||
assert(three.eq(three2).allTrue());
|
||||
Float16Vector three3 = three2.broadcast(float16ToShortBits(Float16.valueOf(1))).broadcast(Float16.valueOf(-3).longValue());
|
||||
Float16Vector three3 = three2.broadcast(float16ToRawShortBits(Float16.valueOf(1))).broadcast(Float16.valueOf(-3).longValue());
|
||||
assert(three.eq(three3).allTrue());
|
||||
int scale = 2;
|
||||
Class<?> ETYPE = short.class;
|
||||
@ -1877,12 +1839,12 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
Float16Vector higher = three.addIndex(scale);
|
||||
VectorMask<Float16> m = three.compare(VectorOperators.LE, higher);
|
||||
assert(m.allTrue());
|
||||
m = higher.min(float16ToShortBits(Float16.valueOf(-1))).test(VectorOperators.IS_NEGATIVE);
|
||||
m = higher.min(float16ToRawShortBits(Float16.valueOf(-1))).test(VectorOperators.IS_NEGATIVE);
|
||||
assert(m.allTrue());
|
||||
m = higher.test(VectorOperators.IS_FINITE);
|
||||
assert(m.allTrue());
|
||||
short max = higher.reduceLanes(VectorOperators.MAX);
|
||||
assert(max == float16ToShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
assert(max == float16ToRawShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
}
|
||||
|
||||
private static short[]
|
||||
@ -2461,6 +2423,8 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, Float16Vector128Tests::ADD);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MIN = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MINFloat16Vector128TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2469,13 +2433,15 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector128Tests::MIN);
|
||||
}
|
||||
|
||||
static Float16Vector bv_min = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void minFloat16Vector128TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,13 +2450,15 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector128Tests::min);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MIN_M = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MINFloat16Vector128TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2501,13 +2469,15 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, mask, Float16Vector128Tests::MIN);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MAX = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MAXFloat16Vector128TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2516,13 +2486,15 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector128Tests::MAX);
|
||||
}
|
||||
|
||||
static Float16Vector bv_max = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void maxFloat16Vector128TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2531,13 +2503,15 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector128Tests::max);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MAX_M = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MAXFloat16Vector128TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2548,7 +2522,7 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3762,7 +3736,7 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), lt(a[i + j], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
AssertEquals(mv.laneIsSet(j), lt(a[i + j], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3782,7 +3756,7 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (lt(a[i + j],float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (lt(a[i + j],float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3834,7 +3808,7 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), eq(a[i + j], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
AssertEquals(mv.laneIsSet(j), eq(a[i + j], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3854,7 +3828,7 @@ public class Float16Vector128Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (eq(a[i + j],float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (eq(a[i + j],float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,8 +64,6 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static Float16Vector bcast_vec = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
static void AssertEquals(short actual, short expected) {
|
||||
Assert.assertEquals(Float.float16ToFloat((short)actual), Float.float16ToFloat((short)expected));
|
||||
}
|
||||
@ -119,9 +117,9 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
// Identity values for reduction operations
|
||||
private static final short ADD_IDENTITY = (short)0;
|
||||
private static final short FIRST_NONZERO_IDENTITY = (short)0;
|
||||
private static final short MAX_IDENTITY = float16ToShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MIN_IDENTITY = float16ToShortBits(Float16.POSITIVE_INFINITY);
|
||||
private static final short MUL_IDENTITY = float16ToShortBits(Float16.valueOf(1.0f));
|
||||
private static final short MAX_IDENTITY = float16ToRawShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MIN_IDENTITY = float16ToRawShortBits(Float16.POSITIVE_INFINITY);
|
||||
private static final short MUL_IDENTITY = float16ToRawShortBits(Float16.valueOf(1.0f));
|
||||
|
||||
// for floating point addition reduction ops that may introduce rounding errors
|
||||
private static final short RELATIVE_ROUNDING_ERROR_FACTOR_ADD = (short)10.0;
|
||||
@ -205,13 +203,13 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
short relativeErrorFactor) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))));
|
||||
AssertEquals(rc, fa.apply(a), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))));
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))));
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))), "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))), "at index #" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,13 +231,13 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
short relativeError) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))));
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))));
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))));
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))), "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))), "at index #" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -600,10 +598,10 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue()))));
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue()))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(r[i], f.apply(a[i], (float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())))),
|
||||
AssertEquals(r[i], f.apply(a[i], (float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())))),
|
||||
"(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i);
|
||||
}
|
||||
}
|
||||
@ -664,10 +662,10 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())), mask[i % SPECIES.length()]));
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())), mask[i % SPECIES.length()]));
|
||||
}
|
||||
} catch (AssertionError err) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())),
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())),
|
||||
mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] +
|
||||
", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " +
|
||||
mask[i % SPECIES.length()]);
|
||||
@ -1154,23 +1152,9 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
static short genValue(int i) {
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
}
|
||||
|
||||
static int intCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
return Integer.MAX_VALUE;
|
||||
case 1:
|
||||
return Integer.MIN_VALUE;
|
||||
case 2:
|
||||
return Integer.MIN_VALUE;
|
||||
case 3:
|
||||
return Integer.MAX_VALUE;
|
||||
default:
|
||||
return (int)0;
|
||||
}
|
||||
}
|
||||
|
||||
static final List<IntFunction<short[]>> INT_FLOAT16_GENERATORS = List.of(
|
||||
withToString("Float16[-i * 5]", (int s) -> {
|
||||
@ -1184,10 +1168,6 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
withToString("Float16[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (((short)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
}),
|
||||
withToString("Float16[intCornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (short)intCornerCaseValue(i));
|
||||
})
|
||||
);
|
||||
|
||||
@ -1202,23 +1182,9 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static long longCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
return Long.MAX_VALUE;
|
||||
case 1:
|
||||
return Long.MIN_VALUE;
|
||||
case 2:
|
||||
return Long.MIN_VALUE;
|
||||
case 3:
|
||||
return Long.MAX_VALUE;
|
||||
default:
|
||||
return (long)0;
|
||||
}
|
||||
}
|
||||
|
||||
static short genValue(long i) {
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
}
|
||||
|
||||
static final List<IntFunction<short[]>> LONG_FLOAT16_GENERATORS = List.of(
|
||||
@ -1233,10 +1199,6 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
withToString("Float16[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (((short)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
}),
|
||||
withToString("Float16[cornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (short)genValue(longCornerCaseValue(i)));
|
||||
})
|
||||
);
|
||||
|
||||
@ -1571,12 +1533,12 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
|
||||
static short cornerCaseValue(int i) {
|
||||
return switch(i % 8) {
|
||||
case 0 -> float16ToShortBits(Float16.MAX_VALUE);
|
||||
case 1 -> float16ToShortBits(Float16.MIN_VALUE);
|
||||
case 2 -> float16ToShortBits(Float16.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToShortBits(Float16.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToShortBits(Float16.NaN);
|
||||
case 5 -> float16ToShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 0 -> float16ToRawShortBits(Float16.MAX_VALUE);
|
||||
case 1 -> float16ToRawShortBits(Float16.MIN_VALUE);
|
||||
case 2 -> float16ToRawShortBits(Float16.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToRawShortBits(Float16.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToRawShortBits(Float16.NaN);
|
||||
case 5 -> float16ToRawShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 6 -> ((short)0.0);
|
||||
default -> ((short)-0.0);
|
||||
};
|
||||
@ -1643,211 +1605,211 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
static short scalar_add(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.add(at, bt));
|
||||
return float16ToRawShortBits(Float16.add(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_sub(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.subtract(at, bt));
|
||||
return float16ToRawShortBits(Float16.subtract(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_mul(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.multiply(at, bt));
|
||||
return float16ToRawShortBits(Float16.multiply(at, bt));
|
||||
|
||||
}
|
||||
static short scalar_max(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.max(at, bt));
|
||||
return float16ToRawShortBits(Float16.max(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_min(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.min(at, bt));
|
||||
return float16ToRawShortBits(Float16.min(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_div(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.divide(at, bt));
|
||||
return float16ToRawShortBits(Float16.divide(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_fma(short a, short b, short c) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
Float16 ct = shortBitsToFloat16(c);
|
||||
return float16ToShortBits(Float16.fma(at, bt, ct));
|
||||
return float16ToRawShortBits(Float16.fma(at, bt, ct));
|
||||
}
|
||||
|
||||
static short scalar_abs(short a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.abs(at));
|
||||
return float16ToRawShortBits(Float16.abs(at));
|
||||
}
|
||||
|
||||
static short scalar_neg(short a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.valueOf(-at.floatValue()));
|
||||
return float16ToRawShortBits(Float16.valueOf(-at.floatValue()));
|
||||
}
|
||||
|
||||
static short scalar_sin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_exp(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log1p(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log10(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_expm1(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_tan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_sinh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cosh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_tanh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_asin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_acos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_atan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cbrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_sqrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_hypot(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_pow(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_atan2(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_exp(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log1p(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log10(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_expm1(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_tan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sinh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cosh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_tanh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_asin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_acos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_atan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cbrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sqrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_hypot(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_pow(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_atan2(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
@ -1863,10 +1825,10 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
|
||||
@Test
|
||||
static void smokeTest1() {
|
||||
Float16Vector three = Float16Vector.broadcast(SPECIES, float16ToShortBits(Float16.valueOf(-3)));
|
||||
Float16Vector three = Float16Vector.broadcast(SPECIES, float16ToRawShortBits(Float16.valueOf(-3)));
|
||||
Float16Vector three2 = (Float16Vector) SPECIES.broadcast(Float16.valueOf(-3).longValue());
|
||||
assert(three.eq(three2).allTrue());
|
||||
Float16Vector three3 = three2.broadcast(float16ToShortBits(Float16.valueOf(1))).broadcast(Float16.valueOf(-3).longValue());
|
||||
Float16Vector three3 = three2.broadcast(float16ToRawShortBits(Float16.valueOf(1))).broadcast(Float16.valueOf(-3).longValue());
|
||||
assert(three.eq(three3).allTrue());
|
||||
int scale = 2;
|
||||
Class<?> ETYPE = short.class;
|
||||
@ -1877,12 +1839,12 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
Float16Vector higher = three.addIndex(scale);
|
||||
VectorMask<Float16> m = three.compare(VectorOperators.LE, higher);
|
||||
assert(m.allTrue());
|
||||
m = higher.min(float16ToShortBits(Float16.valueOf(-1))).test(VectorOperators.IS_NEGATIVE);
|
||||
m = higher.min(float16ToRawShortBits(Float16.valueOf(-1))).test(VectorOperators.IS_NEGATIVE);
|
||||
assert(m.allTrue());
|
||||
m = higher.test(VectorOperators.IS_FINITE);
|
||||
assert(m.allTrue());
|
||||
short max = higher.reduceLanes(VectorOperators.MAX);
|
||||
assert(max == float16ToShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
assert(max == float16ToRawShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
}
|
||||
|
||||
private static short[]
|
||||
@ -2461,6 +2423,8 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, Float16Vector256Tests::ADD);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MIN = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MINFloat16Vector256TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2469,13 +2433,15 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector256Tests::MIN);
|
||||
}
|
||||
|
||||
static Float16Vector bv_min = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void minFloat16Vector256TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,13 +2450,15 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector256Tests::min);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MIN_M = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MINFloat16Vector256TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2501,13 +2469,15 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, mask, Float16Vector256Tests::MIN);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MAX = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MAXFloat16Vector256TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2516,13 +2486,15 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector256Tests::MAX);
|
||||
}
|
||||
|
||||
static Float16Vector bv_max = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void maxFloat16Vector256TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2531,13 +2503,15 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector256Tests::max);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MAX_M = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MAXFloat16Vector256TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2548,7 +2522,7 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3762,7 +3736,7 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), lt(a[i + j], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
AssertEquals(mv.laneIsSet(j), lt(a[i + j], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3782,7 +3756,7 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (lt(a[i + j],float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (lt(a[i + j],float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3834,7 +3808,7 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), eq(a[i + j], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
AssertEquals(mv.laneIsSet(j), eq(a[i + j], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3854,7 +3828,7 @@ public class Float16Vector256Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (eq(a[i + j],float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (eq(a[i + j],float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,8 +64,6 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static Float16Vector bcast_vec = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
static void AssertEquals(short actual, short expected) {
|
||||
Assert.assertEquals(Float.float16ToFloat((short)actual), Float.float16ToFloat((short)expected));
|
||||
}
|
||||
@ -119,9 +117,9 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
// Identity values for reduction operations
|
||||
private static final short ADD_IDENTITY = (short)0;
|
||||
private static final short FIRST_NONZERO_IDENTITY = (short)0;
|
||||
private static final short MAX_IDENTITY = float16ToShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MIN_IDENTITY = float16ToShortBits(Float16.POSITIVE_INFINITY);
|
||||
private static final short MUL_IDENTITY = float16ToShortBits(Float16.valueOf(1.0f));
|
||||
private static final short MAX_IDENTITY = float16ToRawShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MIN_IDENTITY = float16ToRawShortBits(Float16.POSITIVE_INFINITY);
|
||||
private static final short MUL_IDENTITY = float16ToRawShortBits(Float16.valueOf(1.0f));
|
||||
|
||||
// for floating point addition reduction ops that may introduce rounding errors
|
||||
private static final short RELATIVE_ROUNDING_ERROR_FACTOR_ADD = (short)10.0;
|
||||
@ -205,13 +203,13 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
short relativeErrorFactor) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))));
|
||||
AssertEquals(rc, fa.apply(a), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))));
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))));
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))), "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))), "at index #" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,13 +231,13 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
short relativeError) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))));
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))));
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))));
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))), "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))), "at index #" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -600,10 +598,10 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue()))));
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue()))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(r[i], f.apply(a[i], (float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())))),
|
||||
AssertEquals(r[i], f.apply(a[i], (float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())))),
|
||||
"(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i);
|
||||
}
|
||||
}
|
||||
@ -664,10 +662,10 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())), mask[i % SPECIES.length()]));
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())), mask[i % SPECIES.length()]));
|
||||
}
|
||||
} catch (AssertionError err) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())),
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())),
|
||||
mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] +
|
||||
", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " +
|
||||
mask[i % SPECIES.length()]);
|
||||
@ -1154,23 +1152,9 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
static short genValue(int i) {
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
}
|
||||
|
||||
static int intCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
return Integer.MAX_VALUE;
|
||||
case 1:
|
||||
return Integer.MIN_VALUE;
|
||||
case 2:
|
||||
return Integer.MIN_VALUE;
|
||||
case 3:
|
||||
return Integer.MAX_VALUE;
|
||||
default:
|
||||
return (int)0;
|
||||
}
|
||||
}
|
||||
|
||||
static final List<IntFunction<short[]>> INT_FLOAT16_GENERATORS = List.of(
|
||||
withToString("Float16[-i * 5]", (int s) -> {
|
||||
@ -1184,10 +1168,6 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
withToString("Float16[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (((short)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
}),
|
||||
withToString("Float16[intCornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (short)intCornerCaseValue(i));
|
||||
})
|
||||
);
|
||||
|
||||
@ -1202,23 +1182,9 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static long longCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
return Long.MAX_VALUE;
|
||||
case 1:
|
||||
return Long.MIN_VALUE;
|
||||
case 2:
|
||||
return Long.MIN_VALUE;
|
||||
case 3:
|
||||
return Long.MAX_VALUE;
|
||||
default:
|
||||
return (long)0;
|
||||
}
|
||||
}
|
||||
|
||||
static short genValue(long i) {
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
}
|
||||
|
||||
static final List<IntFunction<short[]>> LONG_FLOAT16_GENERATORS = List.of(
|
||||
@ -1233,10 +1199,6 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
withToString("Float16[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (((short)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
}),
|
||||
withToString("Float16[cornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (short)genValue(longCornerCaseValue(i)));
|
||||
})
|
||||
);
|
||||
|
||||
@ -1571,12 +1533,12 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
|
||||
static short cornerCaseValue(int i) {
|
||||
return switch(i % 8) {
|
||||
case 0 -> float16ToShortBits(Float16.MAX_VALUE);
|
||||
case 1 -> float16ToShortBits(Float16.MIN_VALUE);
|
||||
case 2 -> float16ToShortBits(Float16.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToShortBits(Float16.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToShortBits(Float16.NaN);
|
||||
case 5 -> float16ToShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 0 -> float16ToRawShortBits(Float16.MAX_VALUE);
|
||||
case 1 -> float16ToRawShortBits(Float16.MIN_VALUE);
|
||||
case 2 -> float16ToRawShortBits(Float16.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToRawShortBits(Float16.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToRawShortBits(Float16.NaN);
|
||||
case 5 -> float16ToRawShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 6 -> ((short)0.0);
|
||||
default -> ((short)-0.0);
|
||||
};
|
||||
@ -1643,211 +1605,211 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
static short scalar_add(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.add(at, bt));
|
||||
return float16ToRawShortBits(Float16.add(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_sub(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.subtract(at, bt));
|
||||
return float16ToRawShortBits(Float16.subtract(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_mul(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.multiply(at, bt));
|
||||
return float16ToRawShortBits(Float16.multiply(at, bt));
|
||||
|
||||
}
|
||||
static short scalar_max(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.max(at, bt));
|
||||
return float16ToRawShortBits(Float16.max(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_min(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.min(at, bt));
|
||||
return float16ToRawShortBits(Float16.min(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_div(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.divide(at, bt));
|
||||
return float16ToRawShortBits(Float16.divide(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_fma(short a, short b, short c) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
Float16 ct = shortBitsToFloat16(c);
|
||||
return float16ToShortBits(Float16.fma(at, bt, ct));
|
||||
return float16ToRawShortBits(Float16.fma(at, bt, ct));
|
||||
}
|
||||
|
||||
static short scalar_abs(short a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.abs(at));
|
||||
return float16ToRawShortBits(Float16.abs(at));
|
||||
}
|
||||
|
||||
static short scalar_neg(short a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.valueOf(-at.floatValue()));
|
||||
return float16ToRawShortBits(Float16.valueOf(-at.floatValue()));
|
||||
}
|
||||
|
||||
static short scalar_sin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_exp(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log1p(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log10(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_expm1(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_tan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_sinh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cosh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_tanh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_asin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_acos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_atan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cbrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_sqrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_hypot(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_pow(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_atan2(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_exp(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log1p(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log10(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_expm1(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_tan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sinh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cosh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_tanh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_asin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_acos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_atan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cbrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sqrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_hypot(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_pow(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_atan2(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
@ -1863,10 +1825,10 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
|
||||
@Test
|
||||
static void smokeTest1() {
|
||||
Float16Vector three = Float16Vector.broadcast(SPECIES, float16ToShortBits(Float16.valueOf(-3)));
|
||||
Float16Vector three = Float16Vector.broadcast(SPECIES, float16ToRawShortBits(Float16.valueOf(-3)));
|
||||
Float16Vector three2 = (Float16Vector) SPECIES.broadcast(Float16.valueOf(-3).longValue());
|
||||
assert(three.eq(three2).allTrue());
|
||||
Float16Vector three3 = three2.broadcast(float16ToShortBits(Float16.valueOf(1))).broadcast(Float16.valueOf(-3).longValue());
|
||||
Float16Vector three3 = three2.broadcast(float16ToRawShortBits(Float16.valueOf(1))).broadcast(Float16.valueOf(-3).longValue());
|
||||
assert(three.eq(three3).allTrue());
|
||||
int scale = 2;
|
||||
Class<?> ETYPE = short.class;
|
||||
@ -1877,12 +1839,12 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
Float16Vector higher = three.addIndex(scale);
|
||||
VectorMask<Float16> m = three.compare(VectorOperators.LE, higher);
|
||||
assert(m.allTrue());
|
||||
m = higher.min(float16ToShortBits(Float16.valueOf(-1))).test(VectorOperators.IS_NEGATIVE);
|
||||
m = higher.min(float16ToRawShortBits(Float16.valueOf(-1))).test(VectorOperators.IS_NEGATIVE);
|
||||
assert(m.allTrue());
|
||||
m = higher.test(VectorOperators.IS_FINITE);
|
||||
assert(m.allTrue());
|
||||
short max = higher.reduceLanes(VectorOperators.MAX);
|
||||
assert(max == float16ToShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
assert(max == float16ToRawShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
}
|
||||
|
||||
private static short[]
|
||||
@ -2461,6 +2423,8 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, Float16Vector512Tests::ADD);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MIN = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MINFloat16Vector512TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2469,13 +2433,15 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector512Tests::MIN);
|
||||
}
|
||||
|
||||
static Float16Vector bv_min = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void minFloat16Vector512TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,13 +2450,15 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector512Tests::min);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MIN_M = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MINFloat16Vector512TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2501,13 +2469,15 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, mask, Float16Vector512Tests::MIN);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MAX = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MAXFloat16Vector512TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2516,13 +2486,15 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector512Tests::MAX);
|
||||
}
|
||||
|
||||
static Float16Vector bv_max = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void maxFloat16Vector512TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2531,13 +2503,15 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector512Tests::max);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MAX_M = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MAXFloat16Vector512TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2548,7 +2522,7 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3762,7 +3736,7 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), lt(a[i + j], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
AssertEquals(mv.laneIsSet(j), lt(a[i + j], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3782,7 +3756,7 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (lt(a[i + j],float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (lt(a[i + j],float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3834,7 +3808,7 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), eq(a[i + j], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
AssertEquals(mv.laneIsSet(j), eq(a[i + j], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3854,7 +3828,7 @@ public class Float16Vector512Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (eq(a[i + j],float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (eq(a[i + j],float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,8 +64,6 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static Float16Vector bcast_vec = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
static void AssertEquals(short actual, short expected) {
|
||||
Assert.assertEquals(Float.float16ToFloat((short)actual), Float.float16ToFloat((short)expected));
|
||||
}
|
||||
@ -119,9 +117,9 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
// Identity values for reduction operations
|
||||
private static final short ADD_IDENTITY = (short)0;
|
||||
private static final short FIRST_NONZERO_IDENTITY = (short)0;
|
||||
private static final short MAX_IDENTITY = float16ToShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MIN_IDENTITY = float16ToShortBits(Float16.POSITIVE_INFINITY);
|
||||
private static final short MUL_IDENTITY = float16ToShortBits(Float16.valueOf(1.0f));
|
||||
private static final short MAX_IDENTITY = float16ToRawShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MIN_IDENTITY = float16ToRawShortBits(Float16.POSITIVE_INFINITY);
|
||||
private static final short MUL_IDENTITY = float16ToRawShortBits(Float16.valueOf(1.0f));
|
||||
|
||||
// for floating point addition reduction ops that may introduce rounding errors
|
||||
private static final short RELATIVE_ROUNDING_ERROR_FACTOR_ADD = (short)10.0;
|
||||
@ -205,13 +203,13 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
short relativeErrorFactor) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))));
|
||||
AssertEquals(rc, fa.apply(a), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))));
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))));
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))), "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))), "at index #" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,13 +231,13 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
short relativeError) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))));
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))));
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))));
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))), "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))), "at index #" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -600,10 +598,10 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue()))));
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue()))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(r[i], f.apply(a[i], (float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())))),
|
||||
AssertEquals(r[i], f.apply(a[i], (float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())))),
|
||||
"(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i);
|
||||
}
|
||||
}
|
||||
@ -664,10 +662,10 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())), mask[i % SPECIES.length()]));
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())), mask[i % SPECIES.length()]));
|
||||
}
|
||||
} catch (AssertionError err) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())),
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())),
|
||||
mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] +
|
||||
", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " +
|
||||
mask[i % SPECIES.length()]);
|
||||
@ -1154,23 +1152,9 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
static short genValue(int i) {
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
}
|
||||
|
||||
static int intCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
return Integer.MAX_VALUE;
|
||||
case 1:
|
||||
return Integer.MIN_VALUE;
|
||||
case 2:
|
||||
return Integer.MIN_VALUE;
|
||||
case 3:
|
||||
return Integer.MAX_VALUE;
|
||||
default:
|
||||
return (int)0;
|
||||
}
|
||||
}
|
||||
|
||||
static final List<IntFunction<short[]>> INT_FLOAT16_GENERATORS = List.of(
|
||||
withToString("Float16[-i * 5]", (int s) -> {
|
||||
@ -1184,10 +1168,6 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
withToString("Float16[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (((short)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
}),
|
||||
withToString("Float16[intCornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (short)intCornerCaseValue(i));
|
||||
})
|
||||
);
|
||||
|
||||
@ -1202,23 +1182,9 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static long longCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
return Long.MAX_VALUE;
|
||||
case 1:
|
||||
return Long.MIN_VALUE;
|
||||
case 2:
|
||||
return Long.MIN_VALUE;
|
||||
case 3:
|
||||
return Long.MAX_VALUE;
|
||||
default:
|
||||
return (long)0;
|
||||
}
|
||||
}
|
||||
|
||||
static short genValue(long i) {
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
}
|
||||
|
||||
static final List<IntFunction<short[]>> LONG_FLOAT16_GENERATORS = List.of(
|
||||
@ -1233,10 +1199,6 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
withToString("Float16[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (((short)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
}),
|
||||
withToString("Float16[cornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (short)genValue(longCornerCaseValue(i)));
|
||||
})
|
||||
);
|
||||
|
||||
@ -1571,12 +1533,12 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
|
||||
static short cornerCaseValue(int i) {
|
||||
return switch(i % 8) {
|
||||
case 0 -> float16ToShortBits(Float16.MAX_VALUE);
|
||||
case 1 -> float16ToShortBits(Float16.MIN_VALUE);
|
||||
case 2 -> float16ToShortBits(Float16.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToShortBits(Float16.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToShortBits(Float16.NaN);
|
||||
case 5 -> float16ToShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 0 -> float16ToRawShortBits(Float16.MAX_VALUE);
|
||||
case 1 -> float16ToRawShortBits(Float16.MIN_VALUE);
|
||||
case 2 -> float16ToRawShortBits(Float16.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToRawShortBits(Float16.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToRawShortBits(Float16.NaN);
|
||||
case 5 -> float16ToRawShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 6 -> ((short)0.0);
|
||||
default -> ((short)-0.0);
|
||||
};
|
||||
@ -1643,211 +1605,211 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
static short scalar_add(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.add(at, bt));
|
||||
return float16ToRawShortBits(Float16.add(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_sub(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.subtract(at, bt));
|
||||
return float16ToRawShortBits(Float16.subtract(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_mul(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.multiply(at, bt));
|
||||
return float16ToRawShortBits(Float16.multiply(at, bt));
|
||||
|
||||
}
|
||||
static short scalar_max(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.max(at, bt));
|
||||
return float16ToRawShortBits(Float16.max(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_min(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.min(at, bt));
|
||||
return float16ToRawShortBits(Float16.min(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_div(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.divide(at, bt));
|
||||
return float16ToRawShortBits(Float16.divide(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_fma(short a, short b, short c) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
Float16 ct = shortBitsToFloat16(c);
|
||||
return float16ToShortBits(Float16.fma(at, bt, ct));
|
||||
return float16ToRawShortBits(Float16.fma(at, bt, ct));
|
||||
}
|
||||
|
||||
static short scalar_abs(short a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.abs(at));
|
||||
return float16ToRawShortBits(Float16.abs(at));
|
||||
}
|
||||
|
||||
static short scalar_neg(short a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.valueOf(-at.floatValue()));
|
||||
return float16ToRawShortBits(Float16.valueOf(-at.floatValue()));
|
||||
}
|
||||
|
||||
static short scalar_sin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_exp(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log1p(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log10(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_expm1(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_tan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_sinh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cosh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_tanh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_asin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_acos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_atan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cbrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_sqrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_hypot(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_pow(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_atan2(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_exp(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log1p(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log10(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_expm1(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_tan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sinh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cosh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_tanh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_asin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_acos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_atan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cbrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sqrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_hypot(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_pow(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_atan2(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
@ -1863,10 +1825,10 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
|
||||
@Test
|
||||
static void smokeTest1() {
|
||||
Float16Vector three = Float16Vector.broadcast(SPECIES, float16ToShortBits(Float16.valueOf(-3)));
|
||||
Float16Vector three = Float16Vector.broadcast(SPECIES, float16ToRawShortBits(Float16.valueOf(-3)));
|
||||
Float16Vector three2 = (Float16Vector) SPECIES.broadcast(Float16.valueOf(-3).longValue());
|
||||
assert(three.eq(three2).allTrue());
|
||||
Float16Vector three3 = three2.broadcast(float16ToShortBits(Float16.valueOf(1))).broadcast(Float16.valueOf(-3).longValue());
|
||||
Float16Vector three3 = three2.broadcast(float16ToRawShortBits(Float16.valueOf(1))).broadcast(Float16.valueOf(-3).longValue());
|
||||
assert(three.eq(three3).allTrue());
|
||||
int scale = 2;
|
||||
Class<?> ETYPE = short.class;
|
||||
@ -1877,12 +1839,12 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
Float16Vector higher = three.addIndex(scale);
|
||||
VectorMask<Float16> m = three.compare(VectorOperators.LE, higher);
|
||||
assert(m.allTrue());
|
||||
m = higher.min(float16ToShortBits(Float16.valueOf(-1))).test(VectorOperators.IS_NEGATIVE);
|
||||
m = higher.min(float16ToRawShortBits(Float16.valueOf(-1))).test(VectorOperators.IS_NEGATIVE);
|
||||
assert(m.allTrue());
|
||||
m = higher.test(VectorOperators.IS_FINITE);
|
||||
assert(m.allTrue());
|
||||
short max = higher.reduceLanes(VectorOperators.MAX);
|
||||
assert(max == float16ToShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
assert(max == float16ToRawShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
}
|
||||
|
||||
private static short[]
|
||||
@ -2461,6 +2423,8 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, Float16Vector64Tests::ADD);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MIN = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MINFloat16Vector64TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2469,13 +2433,15 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector64Tests::MIN);
|
||||
}
|
||||
|
||||
static Float16Vector bv_min = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void minFloat16Vector64TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,13 +2450,15 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector64Tests::min);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MIN_M = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MINFloat16Vector64TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2501,13 +2469,15 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, mask, Float16Vector64Tests::MIN);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MAX = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MAXFloat16Vector64TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2516,13 +2486,15 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector64Tests::MAX);
|
||||
}
|
||||
|
||||
static Float16Vector bv_max = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void maxFloat16Vector64TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2531,13 +2503,15 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16Vector64Tests::max);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MAX_M = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MAXFloat16Vector64TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2548,7 +2522,7 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3762,7 +3736,7 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), lt(a[i + j], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
AssertEquals(mv.laneIsSet(j), lt(a[i + j], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3782,7 +3756,7 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (lt(a[i + j],float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (lt(a[i + j],float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3834,7 +3808,7 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), eq(a[i + j], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
AssertEquals(mv.laneIsSet(j), eq(a[i + j], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3854,7 +3828,7 @@ public class Float16Vector64Tests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (eq(a[i + j],float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (eq(a[i + j],float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,8 +64,6 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static Float16Vector bcast_vec = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
static void AssertEquals(short actual, short expected) {
|
||||
Assert.assertEquals(Float.float16ToFloat((short)actual), Float.float16ToFloat((short)expected));
|
||||
}
|
||||
@ -125,9 +123,9 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
// Identity values for reduction operations
|
||||
private static final short ADD_IDENTITY = (short)0;
|
||||
private static final short FIRST_NONZERO_IDENTITY = (short)0;
|
||||
private static final short MAX_IDENTITY = float16ToShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MIN_IDENTITY = float16ToShortBits(Float16.POSITIVE_INFINITY);
|
||||
private static final short MUL_IDENTITY = float16ToShortBits(Float16.valueOf(1.0f));
|
||||
private static final short MAX_IDENTITY = float16ToRawShortBits(Float16.NEGATIVE_INFINITY);
|
||||
private static final short MIN_IDENTITY = float16ToRawShortBits(Float16.POSITIVE_INFINITY);
|
||||
private static final short MUL_IDENTITY = float16ToRawShortBits(Float16.valueOf(1.0f));
|
||||
|
||||
// for floating point addition reduction ops that may introduce rounding errors
|
||||
private static final short RELATIVE_ROUNDING_ERROR_FACTOR_ADD = (short)10.0;
|
||||
@ -211,13 +209,13 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
short relativeErrorFactor) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))));
|
||||
AssertEquals(rc, fa.apply(a), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))));
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))));
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))), "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))), "at index #" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -239,13 +237,13 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
short relativeError) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))));
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))));
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))));
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))), "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))), "at index #" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -606,10 +604,10 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue()))));
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue()))));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(r[i], f.apply(a[i], (float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())))),
|
||||
AssertEquals(r[i], f.apply(a[i], (float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())))),
|
||||
"(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i);
|
||||
}
|
||||
}
|
||||
@ -670,10 +668,10 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())), mask[i % SPECIES.length()]));
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())), mask[i % SPECIES.length()]));
|
||||
}
|
||||
} catch (AssertionError err) {
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())),
|
||||
AssertEquals(r[i], f.apply(a[i], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())),
|
||||
mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] +
|
||||
", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " +
|
||||
mask[i % SPECIES.length()]);
|
||||
@ -1160,23 +1158,9 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
static short genValue(int i) {
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
}
|
||||
|
||||
static int intCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
return Integer.MAX_VALUE;
|
||||
case 1:
|
||||
return Integer.MIN_VALUE;
|
||||
case 2:
|
||||
return Integer.MIN_VALUE;
|
||||
case 3:
|
||||
return Integer.MAX_VALUE;
|
||||
default:
|
||||
return (int)0;
|
||||
}
|
||||
}
|
||||
|
||||
static final List<IntFunction<short[]>> INT_FLOAT16_GENERATORS = List.of(
|
||||
withToString("Float16[-i * 5]", (int s) -> {
|
||||
@ -1190,10 +1174,6 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
withToString("Float16[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (((short)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
}),
|
||||
withToString("Float16[intCornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (short)intCornerCaseValue(i));
|
||||
})
|
||||
);
|
||||
|
||||
@ -1208,23 +1188,9 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static long longCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
return Long.MAX_VALUE;
|
||||
case 1:
|
||||
return Long.MIN_VALUE;
|
||||
case 2:
|
||||
return Long.MIN_VALUE;
|
||||
case 3:
|
||||
return Long.MAX_VALUE;
|
||||
default:
|
||||
return (long)0;
|
||||
}
|
||||
}
|
||||
|
||||
static short genValue(long i) {
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
}
|
||||
|
||||
static final List<IntFunction<short[]>> LONG_FLOAT16_GENERATORS = List.of(
|
||||
@ -1239,10 +1205,6 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
withToString("Float16[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (((short)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
}),
|
||||
withToString("Float16[cornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> (short)genValue(longCornerCaseValue(i)));
|
||||
})
|
||||
);
|
||||
|
||||
@ -1577,12 +1539,12 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
static short cornerCaseValue(int i) {
|
||||
return switch(i % 8) {
|
||||
case 0 -> float16ToShortBits(Float16.MAX_VALUE);
|
||||
case 1 -> float16ToShortBits(Float16.MIN_VALUE);
|
||||
case 2 -> float16ToShortBits(Float16.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToShortBits(Float16.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToShortBits(Float16.NaN);
|
||||
case 5 -> float16ToShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 0 -> float16ToRawShortBits(Float16.MAX_VALUE);
|
||||
case 1 -> float16ToRawShortBits(Float16.MIN_VALUE);
|
||||
case 2 -> float16ToRawShortBits(Float16.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToRawShortBits(Float16.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToRawShortBits(Float16.NaN);
|
||||
case 5 -> float16ToRawShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 6 -> ((short)0.0);
|
||||
default -> ((short)-0.0);
|
||||
};
|
||||
@ -1649,211 +1611,211 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
static short scalar_add(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.add(at, bt));
|
||||
return float16ToRawShortBits(Float16.add(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_sub(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.subtract(at, bt));
|
||||
return float16ToRawShortBits(Float16.subtract(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_mul(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.multiply(at, bt));
|
||||
return float16ToRawShortBits(Float16.multiply(at, bt));
|
||||
|
||||
}
|
||||
static short scalar_max(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.max(at, bt));
|
||||
return float16ToRawShortBits(Float16.max(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_min(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.min(at, bt));
|
||||
return float16ToRawShortBits(Float16.min(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_div(short a, short b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.divide(at, bt));
|
||||
return float16ToRawShortBits(Float16.divide(at, bt));
|
||||
}
|
||||
|
||||
static short scalar_fma(short a, short b, short c) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
Float16 ct = shortBitsToFloat16(c);
|
||||
return float16ToShortBits(Float16.fma(at, bt, ct));
|
||||
return float16ToRawShortBits(Float16.fma(at, bt, ct));
|
||||
}
|
||||
|
||||
static short scalar_abs(short a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.abs(at));
|
||||
return float16ToRawShortBits(Float16.abs(at));
|
||||
}
|
||||
|
||||
static short scalar_neg(short a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.valueOf(-at.floatValue()));
|
||||
return float16ToRawShortBits(Float16.valueOf(-at.floatValue()));
|
||||
}
|
||||
|
||||
static short scalar_sin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_exp(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log1p(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_log10(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_expm1(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_tan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_sinh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cosh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_tanh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_asin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_acos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_atan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_cbrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_sqrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_hypot(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_pow(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short scalar_atan2(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_exp(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log1p(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_log10(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_expm1(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_tan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sinh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cosh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_tanh(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_asin(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_acos(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_atan(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_cbrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_sqrt(short a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_hypot(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_pow(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static short strict_scalar_atan2(short a, short b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
@ -1869,10 +1831,10 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
@Test
|
||||
static void smokeTest1() {
|
||||
Float16Vector three = Float16Vector.broadcast(SPECIES, float16ToShortBits(Float16.valueOf(-3)));
|
||||
Float16Vector three = Float16Vector.broadcast(SPECIES, float16ToRawShortBits(Float16.valueOf(-3)));
|
||||
Float16Vector three2 = (Float16Vector) SPECIES.broadcast(Float16.valueOf(-3).longValue());
|
||||
assert(three.eq(three2).allTrue());
|
||||
Float16Vector three3 = three2.broadcast(float16ToShortBits(Float16.valueOf(1))).broadcast(Float16.valueOf(-3).longValue());
|
||||
Float16Vector three3 = three2.broadcast(float16ToRawShortBits(Float16.valueOf(1))).broadcast(Float16.valueOf(-3).longValue());
|
||||
assert(three.eq(three3).allTrue());
|
||||
int scale = 2;
|
||||
Class<?> ETYPE = short.class;
|
||||
@ -1883,12 +1845,12 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
Float16Vector higher = three.addIndex(scale);
|
||||
VectorMask<Float16> m = three.compare(VectorOperators.LE, higher);
|
||||
assert(m.allTrue());
|
||||
m = higher.min(float16ToShortBits(Float16.valueOf(-1))).test(VectorOperators.IS_NEGATIVE);
|
||||
m = higher.min(float16ToRawShortBits(Float16.valueOf(-1))).test(VectorOperators.IS_NEGATIVE);
|
||||
assert(m.allTrue());
|
||||
m = higher.test(VectorOperators.IS_FINITE);
|
||||
assert(m.allTrue());
|
||||
short max = higher.reduceLanes(VectorOperators.MAX);
|
||||
assert(max == float16ToShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
assert(max == float16ToRawShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
}
|
||||
|
||||
private static short[]
|
||||
@ -2467,6 +2429,8 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, Float16VectorMaxTests::ADD);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MIN = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MINFloat16VectorMaxTestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2475,13 +2439,15 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16VectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static Float16Vector bv_min = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void minFloat16VectorMaxTestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2490,13 +2456,15 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16VectorMaxTests::min);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MIN_M = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MINFloat16VectorMaxTestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2507,13 +2475,15 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, mask, Float16VectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MAX = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MAXFloat16VectorMaxTestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2522,13 +2492,15 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16VectorMaxTests::MAX);
|
||||
}
|
||||
|
||||
static Float16Vector bv_max = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void maxFloat16VectorMaxTestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2537,13 +2509,15 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, Float16VectorMaxTests::max);
|
||||
}
|
||||
|
||||
static Float16Vector bv_MAX_M = Float16Vector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MAXFloat16VectorMaxTestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -2554,7 +2528,7 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
Float16Vector av = Float16Vector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3768,7 +3742,7 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), lt(a[i + j], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
AssertEquals(mv.laneIsSet(j), lt(a[i + j], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3788,7 +3762,7 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (lt(a[i + j],float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (lt(a[i + j],float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3840,7 +3814,7 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), eq(a[i + j], float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
AssertEquals(mv.laneIsSet(j), eq(a[i + j], float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3860,7 +3834,7 @@ public class Float16VectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (eq(a[i + j],float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && (eq(a[i + j],float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,8 +62,6 @@ public class FloatVector128Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static FloatVector bcast_vec = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
static void AssertEquals(float actual, float expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -2414,6 +2412,8 @@ public class FloatVector128Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector128Tests::ADD);
|
||||
}
|
||||
|
||||
static FloatVector bv_MIN = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void MINFloatVector128TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2422,13 +2422,15 @@ public class FloatVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static FloatVector bv_min = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void minFloatVector128TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2437,13 +2439,15 @@ public class FloatVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector128Tests::min);
|
||||
}
|
||||
|
||||
static FloatVector bv_MIN_M = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpMaskProvider")
|
||||
static void MINFloatVector128TestsMaskedWithMemOp(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2454,13 +2458,15 @@ public class FloatVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, mask, FloatVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static FloatVector bv_MAX = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void MAXFloatVector128TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2469,13 +2475,15 @@ public class FloatVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector128Tests::MAX);
|
||||
}
|
||||
|
||||
static FloatVector bv_max = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void maxFloatVector128TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,13 +2492,15 @@ public class FloatVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector128Tests::max);
|
||||
}
|
||||
|
||||
static FloatVector bv_MAX_M = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpMaskProvider")
|
||||
static void MAXFloatVector128TestsMaskedWithMemOp(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2501,7 +2511,7 @@ public class FloatVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,8 +62,6 @@ public class FloatVector256Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static FloatVector bcast_vec = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
static void AssertEquals(float actual, float expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -2414,6 +2412,8 @@ public class FloatVector256Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector256Tests::ADD);
|
||||
}
|
||||
|
||||
static FloatVector bv_MIN = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void MINFloatVector256TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2422,13 +2422,15 @@ public class FloatVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static FloatVector bv_min = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void minFloatVector256TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2437,13 +2439,15 @@ public class FloatVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector256Tests::min);
|
||||
}
|
||||
|
||||
static FloatVector bv_MIN_M = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpMaskProvider")
|
||||
static void MINFloatVector256TestsMaskedWithMemOp(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2454,13 +2458,15 @@ public class FloatVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, mask, FloatVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static FloatVector bv_MAX = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void MAXFloatVector256TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2469,13 +2475,15 @@ public class FloatVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector256Tests::MAX);
|
||||
}
|
||||
|
||||
static FloatVector bv_max = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void maxFloatVector256TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,13 +2492,15 @@ public class FloatVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector256Tests::max);
|
||||
}
|
||||
|
||||
static FloatVector bv_MAX_M = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpMaskProvider")
|
||||
static void MAXFloatVector256TestsMaskedWithMemOp(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2501,7 +2511,7 @@ public class FloatVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,8 +62,6 @@ public class FloatVector512Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static FloatVector bcast_vec = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
static void AssertEquals(float actual, float expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -2414,6 +2412,8 @@ public class FloatVector512Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector512Tests::ADD);
|
||||
}
|
||||
|
||||
static FloatVector bv_MIN = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void MINFloatVector512TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2422,13 +2422,15 @@ public class FloatVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static FloatVector bv_min = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void minFloatVector512TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2437,13 +2439,15 @@ public class FloatVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector512Tests::min);
|
||||
}
|
||||
|
||||
static FloatVector bv_MIN_M = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpMaskProvider")
|
||||
static void MINFloatVector512TestsMaskedWithMemOp(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2454,13 +2458,15 @@ public class FloatVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, mask, FloatVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static FloatVector bv_MAX = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void MAXFloatVector512TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2469,13 +2475,15 @@ public class FloatVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector512Tests::MAX);
|
||||
}
|
||||
|
||||
static FloatVector bv_max = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void maxFloatVector512TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,13 +2492,15 @@ public class FloatVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector512Tests::max);
|
||||
}
|
||||
|
||||
static FloatVector bv_MAX_M = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpMaskProvider")
|
||||
static void MAXFloatVector512TestsMaskedWithMemOp(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2501,7 +2511,7 @@ public class FloatVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,8 +62,6 @@ public class FloatVector64Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static FloatVector bcast_vec = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
static void AssertEquals(float actual, float expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -2414,6 +2412,8 @@ public class FloatVector64Tests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector64Tests::ADD);
|
||||
}
|
||||
|
||||
static FloatVector bv_MIN = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void MINFloatVector64TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2422,13 +2422,15 @@ public class FloatVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static FloatVector bv_min = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void minFloatVector64TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2437,13 +2439,15 @@ public class FloatVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector64Tests::min);
|
||||
}
|
||||
|
||||
static FloatVector bv_MIN_M = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpMaskProvider")
|
||||
static void MINFloatVector64TestsMaskedWithMemOp(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2454,13 +2458,15 @@ public class FloatVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, mask, FloatVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static FloatVector bv_MAX = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void MAXFloatVector64TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2469,13 +2475,15 @@ public class FloatVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector64Tests::MAX);
|
||||
}
|
||||
|
||||
static FloatVector bv_max = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void maxFloatVector64TestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2484,13 +2492,15 @@ public class FloatVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVector64Tests::max);
|
||||
}
|
||||
|
||||
static FloatVector bv_MAX_M = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpMaskProvider")
|
||||
static void MAXFloatVector64TestsMaskedWithMemOp(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2501,7 +2511,7 @@ public class FloatVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,8 +62,6 @@ public class FloatVectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static FloatVector bcast_vec = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
static void AssertEquals(float actual, float expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -2420,6 +2418,8 @@ public class FloatVectorMaxTests extends AbstractVectorTest {
|
||||
assertBroadcastLongArraysEquals(r, a, b, mask, FloatVectorMaxTests::ADD);
|
||||
}
|
||||
|
||||
static FloatVector bv_MIN = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void MINFloatVectorMaxTestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2428,13 +2428,15 @@ public class FloatVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static FloatVector bv_min = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void minFloatVectorMaxTestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2443,13 +2445,15 @@ public class FloatVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVectorMaxTests::min);
|
||||
}
|
||||
|
||||
static FloatVector bv_MIN_M = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpMaskProvider")
|
||||
static void MINFloatVectorMaxTestsMaskedWithMemOp(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2460,13 +2464,15 @@ public class FloatVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, mask, FloatVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static FloatVector bv_MAX = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void MAXFloatVectorMaxTestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2475,13 +2481,15 @@ public class FloatVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVectorMaxTests::MAX);
|
||||
}
|
||||
|
||||
static FloatVector bv_max = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpProvider")
|
||||
static void maxFloatVectorMaxTestsWithMemOp(IntFunction<float[]> fa) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2490,13 +2498,15 @@ public class FloatVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (float)10, FloatVectorMaxTests::max);
|
||||
}
|
||||
|
||||
static FloatVector bv_MAX_M = FloatVector.broadcast(SPECIES, (float)10);
|
||||
|
||||
@Test(dataProvider = "floatUnaryOpMaskProvider")
|
||||
static void MAXFloatVectorMaxTestsMaskedWithMemOp(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
|
||||
float[] a = fa.apply(SPECIES.length());
|
||||
@ -2507,7 +2517,7 @@ public class FloatVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class IntVector128Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static IntVector bcast_vec = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
static void AssertEquals(int actual, int expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3237,6 +3235,8 @@ public class IntVector128Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static IntVector bv_MIN = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void MINIntVector128TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3245,13 +3245,15 @@ public class IntVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static IntVector bv_min = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void minIntVector128TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3260,13 +3262,15 @@ public class IntVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector128Tests::min);
|
||||
}
|
||||
|
||||
static IntVector bv_MIN_M = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpMaskProvider")
|
||||
static void MINIntVector128TestsMaskedWithMemOp(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3277,13 +3281,15 @@ public class IntVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, mask, IntVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static IntVector bv_MAX = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void MAXIntVector128TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3292,13 +3298,15 @@ public class IntVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector128Tests::MAX);
|
||||
}
|
||||
|
||||
static IntVector bv_max = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void maxIntVector128TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3307,13 +3315,15 @@ public class IntVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector128Tests::max);
|
||||
}
|
||||
|
||||
static IntVector bv_MAX_M = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpMaskProvider")
|
||||
static void MAXIntVector128TestsMaskedWithMemOp(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3324,7 +3334,7 @@ public class IntVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class IntVector256Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static IntVector bcast_vec = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
static void AssertEquals(int actual, int expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -197,9 +195,6 @@ public class IntVector256Tests extends AbstractVectorTest {
|
||||
AssertEquals(r[i], f.apply(a, i));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
IO.println("i = " + i);
|
||||
IO.println("rc = " + rc);
|
||||
IO.println("a = " + Arrays.toString(a));
|
||||
AssertEquals(rc, fa.apply(a), "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), "at index #" + i);
|
||||
}
|
||||
@ -3240,6 +3235,8 @@ public class IntVector256Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static IntVector bv_MIN = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void MINIntVector256TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3248,13 +3245,15 @@ public class IntVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static IntVector bv_min = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void minIntVector256TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3263,13 +3262,15 @@ public class IntVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector256Tests::min);
|
||||
}
|
||||
|
||||
static IntVector bv_MIN_M = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpMaskProvider")
|
||||
static void MINIntVector256TestsMaskedWithMemOp(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3280,13 +3281,15 @@ public class IntVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, mask, IntVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static IntVector bv_MAX = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void MAXIntVector256TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3295,13 +3298,15 @@ public class IntVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector256Tests::MAX);
|
||||
}
|
||||
|
||||
static IntVector bv_max = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void maxIntVector256TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3310,13 +3315,15 @@ public class IntVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector256Tests::max);
|
||||
}
|
||||
|
||||
static IntVector bv_MAX_M = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpMaskProvider")
|
||||
static void MAXIntVector256TestsMaskedWithMemOp(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3327,7 +3334,7 @@ public class IntVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class IntVector512Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static IntVector bcast_vec = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
static void AssertEquals(int actual, int expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3237,6 +3235,8 @@ public class IntVector512Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static IntVector bv_MIN = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void MINIntVector512TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3245,13 +3245,15 @@ public class IntVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static IntVector bv_min = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void minIntVector512TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3260,13 +3262,15 @@ public class IntVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector512Tests::min);
|
||||
}
|
||||
|
||||
static IntVector bv_MIN_M = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpMaskProvider")
|
||||
static void MINIntVector512TestsMaskedWithMemOp(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3277,13 +3281,15 @@ public class IntVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, mask, IntVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static IntVector bv_MAX = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void MAXIntVector512TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3292,13 +3298,15 @@ public class IntVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector512Tests::MAX);
|
||||
}
|
||||
|
||||
static IntVector bv_max = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void maxIntVector512TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3307,13 +3315,15 @@ public class IntVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector512Tests::max);
|
||||
}
|
||||
|
||||
static IntVector bv_MAX_M = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpMaskProvider")
|
||||
static void MAXIntVector512TestsMaskedWithMemOp(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3324,7 +3334,7 @@ public class IntVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class IntVector64Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static IntVector bcast_vec = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
static void AssertEquals(int actual, int expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3237,6 +3235,8 @@ public class IntVector64Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static IntVector bv_MIN = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void MINIntVector64TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3245,13 +3245,15 @@ public class IntVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static IntVector bv_min = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void minIntVector64TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3260,13 +3262,15 @@ public class IntVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector64Tests::min);
|
||||
}
|
||||
|
||||
static IntVector bv_MIN_M = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpMaskProvider")
|
||||
static void MINIntVector64TestsMaskedWithMemOp(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3277,13 +3281,15 @@ public class IntVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, mask, IntVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static IntVector bv_MAX = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void MAXIntVector64TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3292,13 +3298,15 @@ public class IntVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector64Tests::MAX);
|
||||
}
|
||||
|
||||
static IntVector bv_max = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void maxIntVector64TestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3307,13 +3315,15 @@ public class IntVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVector64Tests::max);
|
||||
}
|
||||
|
||||
static IntVector bv_MAX_M = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpMaskProvider")
|
||||
static void MAXIntVector64TestsMaskedWithMemOp(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3324,7 +3334,7 @@ public class IntVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class IntVectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static IntVector bcast_vec = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
static void AssertEquals(int actual, int expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3243,6 +3241,8 @@ public class IntVectorMaxTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static IntVector bv_MIN = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void MINIntVectorMaxTestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3251,13 +3251,15 @@ public class IntVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static IntVector bv_min = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void minIntVectorMaxTestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3266,13 +3268,15 @@ public class IntVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVectorMaxTests::min);
|
||||
}
|
||||
|
||||
static IntVector bv_MIN_M = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpMaskProvider")
|
||||
static void MINIntVectorMaxTestsMaskedWithMemOp(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3283,13 +3287,15 @@ public class IntVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, mask, IntVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static IntVector bv_MAX = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void MAXIntVectorMaxTestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3298,13 +3304,15 @@ public class IntVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVectorMaxTests::MAX);
|
||||
}
|
||||
|
||||
static IntVector bv_max = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpProvider")
|
||||
static void maxIntVectorMaxTestsWithMemOp(IntFunction<int[]> fa) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3313,13 +3321,15 @@ public class IntVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (int)10, IntVectorMaxTests::max);
|
||||
}
|
||||
|
||||
static IntVector bv_MAX_M = IntVector.broadcast(SPECIES, (int)10);
|
||||
|
||||
@Test(dataProvider = "intUnaryOpMaskProvider")
|
||||
static void MAXIntVectorMaxTestsMaskedWithMemOp(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
@ -3330,7 +3340,7 @@ public class IntVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class LongVector128Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static LongVector bcast_vec = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
static void AssertEquals(long actual, long expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3253,6 +3251,8 @@ public class LongVector128Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static LongVector bv_MIN = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void MINLongVector128TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3261,13 +3261,15 @@ public class LongVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static LongVector bv_min = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void minLongVector128TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3276,13 +3278,15 @@ public class LongVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector128Tests::min);
|
||||
}
|
||||
|
||||
static LongVector bv_MIN_M = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpMaskProvider")
|
||||
static void MINLongVector128TestsMaskedWithMemOp(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3293,13 +3297,15 @@ public class LongVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, mask, LongVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static LongVector bv_MAX = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void MAXLongVector128TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3308,13 +3314,15 @@ public class LongVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector128Tests::MAX);
|
||||
}
|
||||
|
||||
static LongVector bv_max = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void maxLongVector128TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3323,13 +3331,15 @@ public class LongVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector128Tests::max);
|
||||
}
|
||||
|
||||
static LongVector bv_MAX_M = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpMaskProvider")
|
||||
static void MAXLongVector128TestsMaskedWithMemOp(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3340,7 +3350,7 @@ public class LongVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class LongVector256Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static LongVector bcast_vec = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
static void AssertEquals(long actual, long expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3253,6 +3251,8 @@ public class LongVector256Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static LongVector bv_MIN = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void MINLongVector256TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3261,13 +3261,15 @@ public class LongVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static LongVector bv_min = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void minLongVector256TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3276,13 +3278,15 @@ public class LongVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector256Tests::min);
|
||||
}
|
||||
|
||||
static LongVector bv_MIN_M = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpMaskProvider")
|
||||
static void MINLongVector256TestsMaskedWithMemOp(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3293,13 +3297,15 @@ public class LongVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, mask, LongVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static LongVector bv_MAX = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void MAXLongVector256TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3308,13 +3314,15 @@ public class LongVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector256Tests::MAX);
|
||||
}
|
||||
|
||||
static LongVector bv_max = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void maxLongVector256TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3323,13 +3331,15 @@ public class LongVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector256Tests::max);
|
||||
}
|
||||
|
||||
static LongVector bv_MAX_M = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpMaskProvider")
|
||||
static void MAXLongVector256TestsMaskedWithMemOp(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3340,7 +3350,7 @@ public class LongVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class LongVector512Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static LongVector bcast_vec = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
static void AssertEquals(long actual, long expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3253,6 +3251,8 @@ public class LongVector512Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static LongVector bv_MIN = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void MINLongVector512TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3261,13 +3261,15 @@ public class LongVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static LongVector bv_min = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void minLongVector512TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3276,13 +3278,15 @@ public class LongVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector512Tests::min);
|
||||
}
|
||||
|
||||
static LongVector bv_MIN_M = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpMaskProvider")
|
||||
static void MINLongVector512TestsMaskedWithMemOp(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3293,13 +3297,15 @@ public class LongVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, mask, LongVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static LongVector bv_MAX = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void MAXLongVector512TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3308,13 +3314,15 @@ public class LongVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector512Tests::MAX);
|
||||
}
|
||||
|
||||
static LongVector bv_max = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void maxLongVector512TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3323,13 +3331,15 @@ public class LongVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector512Tests::max);
|
||||
}
|
||||
|
||||
static LongVector bv_MAX_M = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpMaskProvider")
|
||||
static void MAXLongVector512TestsMaskedWithMemOp(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3340,7 +3350,7 @@ public class LongVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class LongVector64Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static LongVector bcast_vec = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
static void AssertEquals(long actual, long expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3253,6 +3251,8 @@ public class LongVector64Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static LongVector bv_MIN = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void MINLongVector64TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3261,13 +3261,15 @@ public class LongVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static LongVector bv_min = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void minLongVector64TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3276,13 +3278,15 @@ public class LongVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector64Tests::min);
|
||||
}
|
||||
|
||||
static LongVector bv_MIN_M = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpMaskProvider")
|
||||
static void MINLongVector64TestsMaskedWithMemOp(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3293,13 +3297,15 @@ public class LongVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, mask, LongVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static LongVector bv_MAX = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void MAXLongVector64TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3308,13 +3314,15 @@ public class LongVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector64Tests::MAX);
|
||||
}
|
||||
|
||||
static LongVector bv_max = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void maxLongVector64TestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3323,13 +3331,15 @@ public class LongVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVector64Tests::max);
|
||||
}
|
||||
|
||||
static LongVector bv_MAX_M = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpMaskProvider")
|
||||
static void MAXLongVector64TestsMaskedWithMemOp(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3340,7 +3350,7 @@ public class LongVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class LongVectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static LongVector bcast_vec = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
static void AssertEquals(long actual, long expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3259,6 +3257,8 @@ public class LongVectorMaxTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static LongVector bv_MIN = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void MINLongVectorMaxTestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3267,13 +3267,15 @@ public class LongVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static LongVector bv_min = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void minLongVectorMaxTestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3282,13 +3284,15 @@ public class LongVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVectorMaxTests::min);
|
||||
}
|
||||
|
||||
static LongVector bv_MIN_M = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpMaskProvider")
|
||||
static void MINLongVectorMaxTestsMaskedWithMemOp(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3299,13 +3303,15 @@ public class LongVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, mask, LongVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static LongVector bv_MAX = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void MAXLongVectorMaxTestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3314,13 +3320,15 @@ public class LongVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVectorMaxTests::MAX);
|
||||
}
|
||||
|
||||
static LongVector bv_max = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpProvider")
|
||||
static void maxLongVectorMaxTestsWithMemOp(IntFunction<long[]> fa) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3329,13 +3337,15 @@ public class LongVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (long)10, LongVectorMaxTests::max);
|
||||
}
|
||||
|
||||
static LongVector bv_MAX_M = LongVector.broadcast(SPECIES, (long)10);
|
||||
|
||||
@Test(dataProvider = "longUnaryOpMaskProvider")
|
||||
static void MAXLongVectorMaxTestsMaskedWithMemOp(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
@ -3346,7 +3356,7 @@ public class LongVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class ShortVector128Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static ShortVector bcast_vec = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
static void AssertEquals(short actual, short expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3189,6 +3187,8 @@ public class ShortVector128Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static ShortVector bv_MIN = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MINShortVector128TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3197,13 +3197,15 @@ public class ShortVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static ShortVector bv_min = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void minShortVector128TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3212,13 +3214,15 @@ public class ShortVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector128Tests::min);
|
||||
}
|
||||
|
||||
static ShortVector bv_MIN_M = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MINShortVector128TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3229,13 +3233,15 @@ public class ShortVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, mask, ShortVector128Tests::MIN);
|
||||
}
|
||||
|
||||
static ShortVector bv_MAX = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MAXShortVector128TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3244,13 +3250,15 @@ public class ShortVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector128Tests::MAX);
|
||||
}
|
||||
|
||||
static ShortVector bv_max = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void maxShortVector128TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3259,13 +3267,15 @@ public class ShortVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector128Tests::max);
|
||||
}
|
||||
|
||||
static ShortVector bv_MAX_M = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MAXShortVector128TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3276,7 +3286,7 @@ public class ShortVector128Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class ShortVector256Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static ShortVector bcast_vec = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
static void AssertEquals(short actual, short expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3189,6 +3187,8 @@ public class ShortVector256Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static ShortVector bv_MIN = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MINShortVector256TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3197,13 +3197,15 @@ public class ShortVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static ShortVector bv_min = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void minShortVector256TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3212,13 +3214,15 @@ public class ShortVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector256Tests::min);
|
||||
}
|
||||
|
||||
static ShortVector bv_MIN_M = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MINShortVector256TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3229,13 +3233,15 @@ public class ShortVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, mask, ShortVector256Tests::MIN);
|
||||
}
|
||||
|
||||
static ShortVector bv_MAX = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MAXShortVector256TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3244,13 +3250,15 @@ public class ShortVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector256Tests::MAX);
|
||||
}
|
||||
|
||||
static ShortVector bv_max = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void maxShortVector256TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3259,13 +3267,15 @@ public class ShortVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector256Tests::max);
|
||||
}
|
||||
|
||||
static ShortVector bv_MAX_M = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MAXShortVector256TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3276,7 +3286,7 @@ public class ShortVector256Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class ShortVector512Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static ShortVector bcast_vec = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
static void AssertEquals(short actual, short expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3189,6 +3187,8 @@ public class ShortVector512Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static ShortVector bv_MIN = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MINShortVector512TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3197,13 +3197,15 @@ public class ShortVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static ShortVector bv_min = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void minShortVector512TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3212,13 +3214,15 @@ public class ShortVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector512Tests::min);
|
||||
}
|
||||
|
||||
static ShortVector bv_MIN_M = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MINShortVector512TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3229,13 +3233,15 @@ public class ShortVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, mask, ShortVector512Tests::MIN);
|
||||
}
|
||||
|
||||
static ShortVector bv_MAX = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MAXShortVector512TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3244,13 +3250,15 @@ public class ShortVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector512Tests::MAX);
|
||||
}
|
||||
|
||||
static ShortVector bv_max = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void maxShortVector512TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3259,13 +3267,15 @@ public class ShortVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector512Tests::max);
|
||||
}
|
||||
|
||||
static ShortVector bv_MAX_M = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MAXShortVector512TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3276,7 +3286,7 @@ public class ShortVector512Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class ShortVector64Tests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static ShortVector bcast_vec = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
static void AssertEquals(short actual, short expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3189,6 +3187,8 @@ public class ShortVector64Tests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static ShortVector bv_MIN = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MINShortVector64TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3197,13 +3197,15 @@ public class ShortVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static ShortVector bv_min = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void minShortVector64TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3212,13 +3214,15 @@ public class ShortVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector64Tests::min);
|
||||
}
|
||||
|
||||
static ShortVector bv_MIN_M = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MINShortVector64TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3229,13 +3233,15 @@ public class ShortVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, mask, ShortVector64Tests::MIN);
|
||||
}
|
||||
|
||||
static ShortVector bv_MAX = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MAXShortVector64TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3244,13 +3250,15 @@ public class ShortVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector64Tests::MAX);
|
||||
}
|
||||
|
||||
static ShortVector bv_max = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void maxShortVector64TestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3259,13 +3267,15 @@ public class ShortVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVector64Tests::max);
|
||||
}
|
||||
|
||||
static ShortVector bv_MAX_M = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MAXShortVector64TestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3276,7 +3286,7 @@ public class ShortVector64Tests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,6 @@ public class ShortVectorMaxTests extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static ShortVector bcast_vec = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
static void AssertEquals(short actual, short expected) {
|
||||
Assert.assertEquals(actual, expected);
|
||||
}
|
||||
@ -3195,6 +3193,8 @@ public class ShortVectorMaxTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
|
||||
static ShortVector bv_MIN = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MINShortVectorMaxTestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3203,13 +3203,15 @@ public class ShortVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static ShortVector bv_min = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void minShortVectorMaxTestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3218,13 +3220,15 @@ public class ShortVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.min(bcast_vec).intoArray(r, i);
|
||||
av.min(bv_min).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVectorMaxTests::min);
|
||||
}
|
||||
|
||||
static ShortVector bv_MIN_M = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MINShortVectorMaxTestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3235,13 +3239,15 @@ public class ShortVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, mask, ShortVectorMaxTests::MIN);
|
||||
}
|
||||
|
||||
static ShortVector bv_MAX = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void MAXShortVectorMaxTestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3250,13 +3256,15 @@ public class ShortVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVectorMaxTests::MAX);
|
||||
}
|
||||
|
||||
static ShortVector bv_max = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpProvider")
|
||||
static void maxShortVectorMaxTestsWithMemOp(IntFunction<short[]> fa) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3265,13 +3273,15 @@ public class ShortVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.max(bcast_vec).intoArray(r, i);
|
||||
av.max(bv_max).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, (short)10, ShortVectorMaxTests::max);
|
||||
}
|
||||
|
||||
static ShortVector bv_MAX_M = ShortVector.broadcast(SPECIES, (short)10);
|
||||
|
||||
@Test(dataProvider = "shortUnaryOpMaskProvider")
|
||||
static void MAXShortVectorMaxTestsMaskedWithMemOp(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
@ -3282,7 +3292,7 @@ public class ShortVectorMaxTests extends AbstractVectorTest {
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -385,7 +385,7 @@ function gen_bool_reduction_op {
|
||||
}
|
||||
|
||||
function gen_saturating_reduction_op {
|
||||
echo "Generating saturating reduction op $1 ($2) ($4)..."
|
||||
echo "Generating saturating reduction op $1 ($2)..."
|
||||
gen_op_tmpl $reduction_scalar_func "$@"
|
||||
gen_op_tmpl $reduction_saturating_op "$@"
|
||||
gen_op_tmpl $reduction_scalar_masked_func "$@"
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
$abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.[[TEST]], bcast_vec, vmask).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.[[TEST]], bv_[[TEST]]_M, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,6 @@
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
$abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.[[TEST]], bcast_vec).intoArray(r, i);
|
||||
av.lanewise(VectorOperators.[[TEST]], bv_[[TEST]]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
|
||||
static $abstractvectortype$ bv_[[TEST]]_M = $abstractvectortype$.broadcast(SPECIES, ($type$)10);
|
||||
|
||||
@Test(dataProvider = "$type$UnaryOpMaskProvider")
|
||||
static void [[TEST]]$vectorteststype$MaskedWithMemOp(IntFunction<$type$[]> fa, IntFunction<boolean[]> fm) {
|
||||
[[KERNEL]]
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
|
||||
static $abstractvectortype$ bv_[[TEST]] = $abstractvectortype$.broadcast(SPECIES, ($type$)10);
|
||||
|
||||
@Test(dataProvider = "$type$UnaryOpProvider")
|
||||
static void [[TEST]]$vectorteststype$WithMemOp(IntFunction<$type$[]> fa) {
|
||||
[[KERNEL]]
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), [[TEST_OP]](a[i + j], {#if[FP16]?float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())):($type$)((long)b[i])}));
|
||||
AssertEquals(mv.laneIsSet(j), [[TEST_OP]](a[i + j], {#if[FP16]?float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())):($type$)((long)b[i])}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -67,7 +67,7 @@
|
||||
|
||||
// Check results as part of computation.
|
||||
for (int j = 0; j < SPECIES.length(); j++) {
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && ([[TEST_OP]](a[i + j],{#if[FP16]?float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())):($type$)((long)b[i])})));
|
||||
AssertEquals(mv.laneIsSet(j), mask[j] && ([[TEST_OP]](a[i + j],{#if[FP16]?float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[i]).longValue())):($type$)((long)b[i])})));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,8 +92,6 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
|
||||
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
|
||||
|
||||
static $abstractvectortype$ bcast_vec = $abstractvectortype$.broadcast(SPECIES, ($type$)10);
|
||||
|
||||
#if[FP16]
|
||||
static void AssertEquals($type$ actual, $type$ expected) {
|
||||
Assert.assertEquals(Float.float16ToFloat((short)actual), Float.float16ToFloat((short)expected));
|
||||
@ -193,9 +191,9 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
private static final $type$ AND_IDENTITY = ($type$)-1;
|
||||
#end[BITWISE]
|
||||
private static final $type$ FIRST_NONZERO_IDENTITY = ($type$)0;
|
||||
private static final $type$ MAX_IDENTITY = {#if[FP16]?float16ToShortBits($Wideboxtype$.$MinValue$):$Wideboxtype$.$MinValue$};
|
||||
private static final $type$ MIN_IDENTITY = {#if[FP16]?float16ToShortBits($Wideboxtype$.$MaxValue$):$Wideboxtype$.$MaxValue$};
|
||||
private static final $type$ MUL_IDENTITY = {#if[FP16]?float16ToShortBits(Float16.valueOf(1.0f)):($type$)1};
|
||||
private static final $type$ MAX_IDENTITY = {#if[FP16]?float16ToRawShortBits($Wideboxtype$.$MinValue$):$Wideboxtype$.$MinValue$};
|
||||
private static final $type$ MIN_IDENTITY = {#if[FP16]?float16ToRawShortBits($Wideboxtype$.$MaxValue$):$Wideboxtype$.$MaxValue$};
|
||||
private static final $type$ MUL_IDENTITY = {#if[FP16]?float16ToRawShortBits(Float16.valueOf(1.0f)):($type$)1};
|
||||
#if[BITWISE]
|
||||
private static final $type$ OR_IDENTITY = ($type$)0;
|
||||
private static final $type$ SUADD_IDENTITY = ($type$)0;
|
||||
@ -312,13 +310,13 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
$type$ relativeErrorFactor) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a), {#if[FP16]?float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))):Math.ulp(rc) * relativeErrorFactor});
|
||||
AssertEquals(rc, fa.apply(a), {#if[FP16]?float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))):Math.ulp(rc) * relativeErrorFactor});
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i), {#if[FP16]?float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))):Math.ulp(r[i]) * relativeErrorFactor});
|
||||
AssertEquals(r[i], f.apply(a, i), {#if[FP16]?float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))):Math.ulp(r[i]) * relativeErrorFactor});
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a), {#if[FP16]?float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))):Math.ulp(rc) * relativeErrorFactor}, "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), {#if[FP16]?float16ToShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))):Math.ulp(r[i]) * relativeErrorFactor}, "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a), {#if[FP16]?float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(rc)), shortBitsToFloat16(relativeErrorFactor))):Math.ulp(rc) * relativeErrorFactor}, "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i), {#if[FP16]?float16ToRawShortBits(Float16.multiply(Float16.ulp(shortBitsToFloat16(r[i])), shortBitsToFloat16(relativeErrorFactor))):Math.ulp(r[i]) * relativeErrorFactor}, "at index #" + i);
|
||||
}
|
||||
}
|
||||
#end[FP]
|
||||
@ -355,13 +353,13 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
$type$ relativeError) {
|
||||
int i = 0;
|
||||
try {
|
||||
AssertEquals(rc, fa.apply(a, mask), {#if[FP16]?float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))):Math.abs(rc * relativeError)});
|
||||
AssertEquals(rc, fa.apply(a, mask), {#if[FP16]?float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))):Math.abs(rc * relativeError)});
|
||||
for (; i < a.length; i += SPECIES.length()) {
|
||||
AssertEquals(r[i], f.apply(a, i, mask), {#if[FP16]?float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))):Math.abs(r[i] * relativeError)});
|
||||
AssertEquals(r[i], f.apply(a, i, mask), {#if[FP16]?float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))):Math.abs(r[i] * relativeError)});
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(rc, fa.apply(a, mask), {#if[FP16]?float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))):Math.abs(rc * relativeError)}, "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), {#if[FP16]?float16ToShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))):Math.abs(r[i] * relativeError)}, "at index #" + i);
|
||||
AssertEquals(rc, fa.apply(a, mask), {#if[FP16]?float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(rc), shortBitsToFloat16(relativeError)))):Math.abs(rc * relativeError)}, "Final result is incorrect!");
|
||||
AssertEquals(r[i], f.apply(a, i, mask), {#if[FP16]?float16ToRawShortBits(Float16.abs(Float16.multiply(shortBitsToFloat16(r[i]), shortBitsToFloat16(relativeError)))):Math.abs(r[i] * relativeError)}, "at index #" + i);
|
||||
}
|
||||
}
|
||||
#end[FP]
|
||||
@ -725,10 +723,10 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], {#if[FP16]?float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())):($type$)(long)b[(i / SPECIES.length()) * SPECIES.length()]}));
|
||||
AssertEquals(r[i], f.apply(a[i], {#if[FP16]?float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())):($type$)(long)b[(i / SPECIES.length()) * SPECIES.length()]}));
|
||||
}
|
||||
} catch (AssertionError e) {
|
||||
AssertEquals(r[i], f.apply(a[i], ({#if[FP16]?float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())):($type$)(long)b[(i / SPECIES.length()) * SPECIES.length()]})),
|
||||
AssertEquals(r[i], f.apply(a[i], ({#if[FP16]?float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())):($type$)(long)b[(i / SPECIES.length()) * SPECIES.length()]})),
|
||||
"(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i);
|
||||
}
|
||||
}
|
||||
@ -789,10 +787,10 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
int i = 0;
|
||||
try {
|
||||
for (; i < a.length; i++) {
|
||||
AssertEquals(r[i], f.apply(a[i], {#if[FP16]?float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())):($type$)(long)b[(i / SPECIES.length()) * SPECIES.length()]}, mask[i % SPECIES.length()]));
|
||||
AssertEquals(r[i], f.apply(a[i], {#if[FP16]?float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())):($type$)(long)b[(i / SPECIES.length()) * SPECIES.length()]}, mask[i % SPECIES.length()]));
|
||||
}
|
||||
} catch (AssertionError err) {
|
||||
AssertEquals(r[i], f.apply(a[i], {#if[FP16]?float16ToShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())):($type$)(long)b[(i / SPECIES.length()) * SPECIES.length()]},
|
||||
AssertEquals(r[i], f.apply(a[i], {#if[FP16]?float16ToRawShortBits(Float16.valueOf(shortBitsToFloat16(b[(i / SPECIES.length()) * SPECIES.length()]).longValue())):($type$)(long)b[(i / SPECIES.length()) * SPECIES.length()]},
|
||||
mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] +
|
||||
", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " +
|
||||
mask[i % SPECIES.length()]);
|
||||
@ -1301,7 +1299,7 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
|
||||
static $type$ genValue(int i) {
|
||||
#if[FP16]
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
#else[FP16]
|
||||
return ($type$) i;
|
||||
#end[FP16]
|
||||
@ -1309,6 +1307,7 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
|
||||
#if[!Int]
|
||||
#if[!byteOrShort]
|
||||
#if[!FP16]
|
||||
static int intCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
@ -1323,6 +1322,7 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
return (int)0;
|
||||
}
|
||||
}
|
||||
#end[!FP16]
|
||||
|
||||
static final List<IntFunction<$type$[]>> INT_$TYPE$_GENERATORS = List.of(
|
||||
withToString("$Wideboxtype$[-i * 5]", (int s) -> {
|
||||
@ -1336,10 +1336,12 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
withToString("$Wideboxtype$[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> ((($type$)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
#if[!FP16]
|
||||
}),
|
||||
withToString("$Wideboxtype$[intCornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> ($type$)intCornerCaseValue(i));
|
||||
#end[!FP16]
|
||||
})
|
||||
);
|
||||
#end[!byteOrShort]
|
||||
@ -1362,6 +1364,7 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
|
||||
#if[!Long]
|
||||
#if[FP]
|
||||
#if[!FP16]
|
||||
static long longCornerCaseValue(int i) {
|
||||
switch(i % 5) {
|
||||
case 0:
|
||||
@ -1376,10 +1379,11 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
return (long)0;
|
||||
}
|
||||
}
|
||||
#end[!FP16]
|
||||
|
||||
static $type$ genValue(long i) {
|
||||
#if[FP16]
|
||||
return float16ToShortBits(Float16.valueOf(i));
|
||||
return float16ToRawShortBits(Float16.valueOf(i));
|
||||
#else[FP16]
|
||||
return ($type$) i;
|
||||
#end[FP16]
|
||||
@ -1397,10 +1401,12 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
withToString("$Wideboxtype$[i + 1]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> ((($type$)(i + 1) == 0) ? genValue(1) : genValue(i + 1)));
|
||||
#if[!FP16]
|
||||
}),
|
||||
withToString("$Wideboxtype$[cornerCaseValue(i)]", (int s) -> {
|
||||
return fill(s * BUFFER_REPS,
|
||||
i -> ($type$)genValue(longCornerCaseValue(i)));
|
||||
#end[!FP16]
|
||||
})
|
||||
);
|
||||
#end[FP]
|
||||
@ -1898,12 +1904,12 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
#if[FP]
|
||||
#if[FP16]
|
||||
return switch(i % 8) {
|
||||
case 0 -> float16ToShortBits($Wideboxtype$.MAX_VALUE);
|
||||
case 1 -> float16ToShortBits($Wideboxtype$.MIN_VALUE);
|
||||
case 2 -> float16ToShortBits($Wideboxtype$.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToShortBits($Wideboxtype$.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToShortBits($Wideboxtype$.NaN);
|
||||
case 5 -> float16ToShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 0 -> float16ToRawShortBits($Wideboxtype$.MAX_VALUE);
|
||||
case 1 -> float16ToRawShortBits($Wideboxtype$.MIN_VALUE);
|
||||
case 2 -> float16ToRawShortBits($Wideboxtype$.NEGATIVE_INFINITY);
|
||||
case 3 -> float16ToRawShortBits($Wideboxtype$.POSITIVE_INFINITY);
|
||||
case 4 -> float16ToRawShortBits($Wideboxtype$.NaN);
|
||||
case 5 -> float16ToRawShortBits(shortBitsToFloat16((short)0x7FFA));
|
||||
case 6 -> (($type$)0.0);
|
||||
default -> (($type$)-0.0);
|
||||
};
|
||||
@ -2088,211 +2094,211 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
static $type$ scalar_add($type$ a, $type$ b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.add(at, bt));
|
||||
return float16ToRawShortBits(Float16.add(at, bt));
|
||||
}
|
||||
|
||||
static $type$ scalar_sub($type$ a, $type$ b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.subtract(at, bt));
|
||||
return float16ToRawShortBits(Float16.subtract(at, bt));
|
||||
}
|
||||
|
||||
static $type$ scalar_mul($type$ a, $type$ b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.multiply(at, bt));
|
||||
return float16ToRawShortBits(Float16.multiply(at, bt));
|
||||
|
||||
}
|
||||
static $type$ scalar_max($type$ a, $type$ b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.max(at, bt));
|
||||
return float16ToRawShortBits(Float16.max(at, bt));
|
||||
}
|
||||
|
||||
static $type$ scalar_min($type$ a, $type$ b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.min(at, bt));
|
||||
return float16ToRawShortBits(Float16.min(at, bt));
|
||||
}
|
||||
|
||||
static $type$ scalar_div($type$ a, $type$ b) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
return float16ToShortBits(Float16.divide(at, bt));
|
||||
return float16ToRawShortBits(Float16.divide(at, bt));
|
||||
}
|
||||
|
||||
static $type$ scalar_fma($type$ a, $type$ b, $type$ c) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
Float16 bt = shortBitsToFloat16(b);
|
||||
Float16 ct = shortBitsToFloat16(c);
|
||||
return float16ToShortBits(Float16.fma(at, bt, ct));
|
||||
return float16ToRawShortBits(Float16.fma(at, bt, ct));
|
||||
}
|
||||
|
||||
static $type$ scalar_abs($type$ a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.abs(at));
|
||||
return float16ToRawShortBits(Float16.abs(at));
|
||||
}
|
||||
|
||||
static $type$ scalar_neg($type$ a) {
|
||||
Float16 at = shortBitsToFloat16(a);
|
||||
return float16ToShortBits(Float16.valueOf(-at.floatValue()));
|
||||
return float16ToRawShortBits(Float16.valueOf(-at.floatValue()));
|
||||
}
|
||||
|
||||
static $type$ scalar_sin($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_exp($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_log1p($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_log($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_log10($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_expm1($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_cos($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_tan($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_sinh($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_cosh($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_tanh($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_asin($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_acos($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_atan($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_cbrt($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_sqrt($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_hypot($type$ a, $type$ b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_pow($type$ a, $type$ b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ scalar_atan2($type$ a, $type$ b) {
|
||||
return float16ToShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(Math.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_sin($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_exp($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.exp(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_log1p($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log1p(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_log($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_log10($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.log10(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_expm1($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.expm1(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_cos($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_tan($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_sinh($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sinh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_cosh($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cosh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_tanh($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.tanh(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_asin($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.asin(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_acos($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.acos(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_atan($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_cbrt($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.cbrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_sqrt($type$ a) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.sqrt(shortBitsToFloat16(a).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_hypot($type$ a, $type$ b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.hypot(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_pow($type$ a, $type$ b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.pow(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
|
||||
static $type$ strict_scalar_atan2($type$ a, $type$ b) {
|
||||
return float16ToShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
return float16ToRawShortBits(Float16.valueOf(StrictMath.atan2(shortBitsToFloat16(a).doubleValue(),
|
||||
shortBitsToFloat16(b).doubleValue())));
|
||||
}
|
||||
#else[FP16]
|
||||
@ -2574,10 +2580,10 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
|
||||
@Test
|
||||
static void smokeTest1() {
|
||||
$abstractvectortype$ three = $abstractvectortype$.broadcast(SPECIES, {#if[FP16]?float16ToShortBits(Float16.valueOf(-3)):(byte)-3});
|
||||
$abstractvectortype$ three = $abstractvectortype$.broadcast(SPECIES, {#if[FP16]?float16ToRawShortBits(Float16.valueOf(-3)):(byte)-3});
|
||||
$abstractvectortype$ three2 = ($abstractvectortype$) SPECIES.broadcast({#if[FP16]?Float16.valueOf(-3).longValue():-3});
|
||||
assert(three.eq(three2).allTrue());
|
||||
$abstractvectortype$ three3 = three2.broadcast({#if[FP16]?float16ToShortBits(Float16.valueOf(1)):1}).broadcast({#if[FP16]?Float16.valueOf(-3).longValue():-3});
|
||||
$abstractvectortype$ three3 = three2.broadcast({#if[FP16]?float16ToRawShortBits(Float16.valueOf(1)):1}).broadcast({#if[FP16]?Float16.valueOf(-3).longValue():-3});
|
||||
assert(three.eq(three3).allTrue());
|
||||
int scale = 2;
|
||||
Class<?> ETYPE = $type$.class;
|
||||
@ -2588,7 +2594,7 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
$abstractvectortype$ higher = three.addIndex(scale);
|
||||
VectorMask<$Wideboxtype$> m = three.compare(VectorOperators.LE, higher);
|
||||
assert(m.allTrue());
|
||||
m = higher.min({#if[FP16]?float16ToShortBits(Float16.valueOf(-1)):($type$)-1}).test(VectorOperators.IS_NEGATIVE);
|
||||
m = higher.min({#if[FP16]?float16ToRawShortBits(Float16.valueOf(-1)):($type$)-1}).test(VectorOperators.IS_NEGATIVE);
|
||||
assert(m.allTrue());
|
||||
#if[FP]
|
||||
m = higher.test(VectorOperators.IS_FINITE);
|
||||
@ -2596,7 +2602,7 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
#end[FP]
|
||||
$type$ max = higher.reduceLanes(VectorOperators.MAX);
|
||||
#if[FP16]
|
||||
assert(max == float16ToShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
assert(max == float16ToRawShortBits(Float16.add(Float16.valueOf(-3), Float16.multiply(Float16.valueOf(scale), Float16.valueOf((SPECIES.length()-1))))));
|
||||
#else[FP16]
|
||||
assert(max == -3 + scale * (SPECIES.length()-1));
|
||||
#end[FP16]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user