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

test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java

Print this page
rev 8688 : 1234567: Invalid bug number
Summary: This is a local commit to reduce jprt submit time.
Reviewed-by: kvn

*** 65,75 **** } else { deoptimize(); compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE); } ! if (!isIntrinsicSupported()) { 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); --- 65,75 ---- } else { deoptimize(); compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE); } ! 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 **** throw new RuntimeException("Test bug, expected compilation (level): " + level + ", but level: " + compilationLevel); } } } ! protected abstract boolean isIntrinsicSupported(); protected abstract String getIntrinsicId(); protected boolean isServerVM() { return javaVmName.toLowerCase().contains("server"); } static class IntTest extends IntrinsicBase { protected IntTest(MathIntrinsic.IntIntrinsic testCase) { super(testCase); } @Override ! protected boolean isIntrinsicSupported() { ! return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) ! && (Platform.isX86() || Platform.isX64() || Platform.isAArch64()); } @Override protected String getIntrinsicId() { return "_" + testCase.name().toLowerCase() + "ExactI"; } } static class LongTest extends IntrinsicBase { protected LongTest(MathIntrinsic.LongIntrinsic testCase) { super(testCase); } @Override ! protected boolean isIntrinsicSupported() { ! return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) && ! (Platform.isX64() || Platform.isPPC() || Platform.isAArch64()); } @Override protected String getIntrinsicId() { return "_" + testCase.name().toLowerCase() + "ExactL"; --- 112,171 ---- throw new RuntimeException("Test bug, expected compilation (level): " + level + ", but level: " + compilationLevel); } } } ! // 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 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 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