test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java	Mon Jul 13 18:44:15 2015
--- new/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java	Mon Jul 13 18:44:15 2015

*** 65,75 **** --- 65,75 ---- } else { deoptimize(); compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE); } ! if (!isIntrinsicSupported()) { ! if (!isIntrinsicAvailable()) { expectedIntrinsicCount = 0; } break; case "interpreted mode": //test is not applicable in this mode; System.err.println("Warning: This test is not applicable in mode: " + MODE);
*** 112,155 **** --- 112,171 ---- throw new RuntimeException("Test bug, expected compilation (level): " + level + ", but level: " + compilationLevel); } } } protected abstract boolean isIntrinsicSupported(); + // An intrinsic is available if: + // - the intrinsic is enabled (by using the appropriate command-line flag) and + // - the intrinsic is supported by the VM (i.e., the platform on which the VM is + // running provides the instructions necessary for the VM to generate the intrinsic). + protected abstract boolean isIntrinsicAvailable(); protected abstract String getIntrinsicId(); protected boolean isServerVM() { return javaVmName.toLowerCase().contains("server"); } static class IntTest extends IntrinsicBase { + + protected boolean isIntrinsicAvailable; // The tested intrinsic is available on the current platform. + protected IntTest(MathIntrinsic.IntIntrinsic testCase) { super(testCase); + // Only the C2 compiler intrinsifies exact math methods + // so check if the intrinsics are available with C2. + isIntrinsicAvailable = WHITE_BOX.isIntrinsicAvailableForMethod(testCase.getTestMethod(), + COMP_LEVEL_FULL_OPTIMIZATION); } @Override ! protected boolean isIntrinsicSupported() { ! return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) && (Platform.isX86() || Platform.isX64() || Platform.isAArch64()); ! protected boolean isIntrinsicAvailable() { ! return isIntrinsicAvailable; } @Override protected String getIntrinsicId() { return "_" + testCase.name().toLowerCase() + "ExactI"; } } static class LongTest extends IntrinsicBase { + + protected boolean isIntrinsicAvailable; // The tested intrinsic is available on the current platform. + protected LongTest(MathIntrinsic.LongIntrinsic testCase) { super(testCase); + // Only the C2 compiler intrinsifies exact math methods + // so check if the intrinsics are available with C2. + isIntrinsicAvailable = WHITE_BOX.isIntrinsicAvailableForMethod(testCase.getTestMethod(), + COMP_LEVEL_FULL_OPTIMIZATION); } @Override ! protected boolean isIntrinsicSupported() { ! return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) && (Platform.isX64() || Platform.isPPC() || Platform.isAArch64()); ! protected boolean isIntrinsicAvailable() { ! return isIntrinsicAvailable; } @Override protected String getIntrinsicId() { return "_" + testCase.name().toLowerCase() + "ExactL";

test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File