--- old/test/hotspot/jtreg/compiler/intrinsics/math/TestFpMinMaxIntrinsics.java 2019-02-07 17:43:09.039095672 +0530 +++ new/test/hotspot/jtreg/compiler/intrinsics/math/TestFpMinMaxIntrinsics.java 2019-02-07 17:43:08.847095667 +0530 @@ -27,14 +27,12 @@ * @bug 8212043 * @summary Test compiler intrinsics of floating-point Math.min/max * - * @run main/othervm -Xint compiler.intrinsics.math.TestFpMinMaxIntrinsics + * @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 - * -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 + * -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions + * -XX:CompileCommand=print,compiler.intrinsics.math.TestFpMinMaxIntrinsics::dTest * compiler.intrinsics.math.TestFpMinMaxIntrinsics */ @@ -62,6 +60,20 @@ 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 }, @@ -74,6 +86,19 @@ 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 }, @@ -93,7 +118,7 @@ return; } if (min != row[2] || max != row[3]) { - throw new AssertionError("Unexpected result of float min/max: " + + throw new AssertionError("Unexpected result of float min/max:" + "a = " + row[0] + ", b = " + row[1] + ", " + "result = (" + min + ", " + max + "), " + "expected = (" + row[2] + ", " + row[3] + ")"); @@ -109,7 +134,7 @@ return; } if (min != row[2] || max != row[3]) { - throw new AssertionError("Unexpected result of double min/max" + + throw new AssertionError("Unexpected result of double min/max:" + "a = " + row[0] + ", b = " + row[1] + ", " + "result = (" + min + ", " + max + "), " + "expected = (" + row[2] + ", " + row[3] + ")"); @@ -117,9 +142,11 @@ } 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"); + } + System.out.println("PASS"); } }