< prev index next >
test/hotspot/jtreg/compiler/intrinsics/math/TestFpMinMaxIntrinsics.java
Print this page
*** 25,42 ****
/*
* @test
* @bug 8212043
* @summary Test compiler intrinsics of floating-point Math.min/max
*
! * @run main/othervm -Xint compiler.intrinsics.math.TestFpMinMaxIntrinsics
* @run main/othervm -XX:+UnlockDiagnosticVMOptions
! * -Xcomp -XX:TieredStopAtLevel=1
! * -XX:CompileOnly=java/lang/Math
! * compiler.intrinsics.math.TestFpMinMaxIntrinsics
! * @run main/othervm -XX:+UnlockDiagnosticVMOptions
! * -Xcomp -XX:-TieredCompilation
! * -XX:CompileOnly=java/lang/Math
* compiler.intrinsics.math.TestFpMinMaxIntrinsics
*/
package compiler.intrinsics.math;
--- 25,40 ----
/*
* @test
* @bug 8212043
* @summary Test compiler intrinsics of floating-point Math.min/max
*
! * @run main/othervm -Xint -XX:+IgnoreUnrecognizedVMOptions compiler.intrinsics.math.TestFpMinMaxIntrinsics
! * @run main/othervm -XX:+UnlockDiagnosticVMOptions -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=1
! * -XX:+IgnoreUnrecognizedVMOptions compiler.intrinsics.math.TestFpMinMaxIntrinsics
* @run main/othervm -XX:+UnlockDiagnosticVMOptions
! * -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions
! * -XX:CompileCommand=print,compiler.intrinsics.math.TestFpMinMaxIntrinsics::dTest
* compiler.intrinsics.math.TestFpMinMaxIntrinsics
*/
package compiler.intrinsics.math;
*** 60,69 ****
--- 58,81 ----
private static final double dNegInf = Double.NEGATIVE_INFINITY;
private static final double dNaN = Double.NaN;
private static final float[][] f_cases = {
// a b min max
+ { fNegZero, fPosZero, fNegZero, fPosZero },
+
+ { fNaN, fPos, fNaN, fNaN },
+ { fNeg, fNaN, fNaN, fNaN },
+ { fNaN, fNeg, fNaN, fNaN },
+
+ { fPosInf, fNaN, fNaN, fNaN },
+ { fNaN, fPosInf, fNaN, fNaN },
+ { fNegInf, fNaN, fNaN, fNaN },
+ { fNaN, fNegInf, fNaN, fNaN },
+
+ { fPos,(float)dNaN, fNaN, fNaN },
+ {(float)dNaN, fPos, fNaN, fNaN },
+
{ fPos, fPos, fPos, fPos },
{ fPos, fNeg, fNeg, fPos },
{ fPosZero, fNegZero, fNegZero, fPosZero },
{ fNegZero, fNegZero, fNegZero, fNegZero },
{ fPos, fPosInf, fPos, fPosInf },
*** 72,81 ****
--- 84,106 ----
{ fNegInf, fNaN, fNaN, fNaN },
};
private static final double[][] d_cases = {
// a b min max
+ { dNegZero, dPosZero, dNegZero, dPosZero },
+
+ { dNaN, dPos, dNaN, dNaN },
+ { dNeg, dNaN, dNaN, dNaN },
+ { dNaN, dNeg, dNaN, dNaN },
+
+ { dPosInf, dNaN, dNaN, dNaN },
+ { dNaN, dPosInf, dNaN, dNaN },
+ { dNaN, dNegInf, dNaN, dNaN },
+
+ { dPos, fNaN, dNaN, dNaN },
+ { fNaN, dPos, dNaN, dNaN },
+
{ dPos, dPos, dPos, dPos },
{ dPos, dNeg, dNeg, dPos },
{ dPosZero, dNegZero, dNegZero, dPosZero },
{ dNegZero, dNegZero, dNegZero, dNegZero },
{ dPos, dPosInf, dPos, dPosInf },
*** 91,101 ****
&& Float.isNaN(row[2]) && Float.isNaN(row[3])) {
// Return if all of them are NaN
return;
}
if (min != row[2] || max != row[3]) {
! throw new AssertionError("Unexpected result of float min/max: " +
"a = " + row[0] + ", b = " + row[1] + ", " +
"result = (" + min + ", " + max + "), " +
"expected = (" + row[2] + ", " + row[3] + ")");
}
}
--- 116,126 ----
&& Float.isNaN(row[2]) && Float.isNaN(row[3])) {
// Return if all of them are NaN
return;
}
if (min != row[2] || max != row[3]) {
! throw new AssertionError("Unexpected result of float min/max:" +
"a = " + row[0] + ", b = " + row[1] + ", " +
"result = (" + min + ", " + max + "), " +
"expected = (" + row[2] + ", " + row[3] + ")");
}
}
*** 107,125 ****
&& Double.isNaN(row[2]) && Double.isNaN(row[3])) {
// Return if all of them are NaN
return;
}
if (min != row[2] || max != row[3]) {
! throw new AssertionError("Unexpected result of double min/max" +
"a = " + row[0] + ", b = " + row[1] + ", " +
"result = (" + min + ", " + max + "), " +
"expected = (" + row[2] + ", " + row[3] + ")");
}
}
public static void main(String[] args) {
Arrays.stream(f_cases).forEach(TestFpMinMaxIntrinsics::fTest);
Arrays.stream(d_cases).forEach(TestFpMinMaxIntrinsics::dTest);
System.out.println("PASS");
}
}
--- 132,152 ----
&& Double.isNaN(row[2]) && Double.isNaN(row[3])) {
// Return if all of them are NaN
return;
}
if (min != row[2] || max != row[3]) {
! throw new AssertionError("Unexpected result of double min/max:" +
"a = " + row[0] + ", b = " + row[1] + ", " +
"result = (" + min + ", " + max + "), " +
"expected = (" + row[2] + ", " + row[3] + ")");
}
}
public static void main(String[] args) {
+ for (int i = 0 ; i < 100000 ; i++) {
Arrays.stream(f_cases).forEach(TestFpMinMaxIntrinsics::fTest);
Arrays.stream(d_cases).forEach(TestFpMinMaxIntrinsics::dTest);
+ }
System.out.println("PASS");
}
}
< prev index next >