changeset 51364:bba832d63b88

8155192: [TESTBUG] SHA tests assumes that x86 does not have SHA intrinsics Reviewed-by: kvn, gromero
author iignatyev
date Fri, 22 Jun 2018 16:11:36 -0700
parents 7755c93d3923
children f82821dc7aba
files test/hotspot/jtreg/compiler/intrinsics/sha/cli/SHAOptionsBase.java test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java
diffstat 6 files changed, 27 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/SHAOptionsBase.java	Fri Jun 22 15:58:32 2018 -0700
+++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/SHAOptionsBase.java	Fri Jun 22 16:11:36 2018 -0700
@@ -74,8 +74,8 @@
      *         instructions required by the option are not supported.
      */
     public static String getWarningForUnsupportedCPU(String optionName) {
-        if (Platform.isAArch64() || Platform.isS390x() || Platform.isSparc() ||
-            Platform.isX64() || Platform.isX86()) {
+        if (Platform.isAArch64() || Platform.isS390x() || Platform.isSparc()
+            || Platform.isX64() || Platform.isX86() || Platform.isPPC()) {
             switch (optionName) {
             case SHAOptionsBase.USE_SHA_OPTION:
                 return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
@@ -89,8 +89,8 @@
                 throw new Error("Unexpected option " + optionName);
             }
         } else {
-            throw new Error("Support for CPUs different fromn AARCH64, S390x, SPARC, and X86 "
-                            + "is not implemented");
+            throw new Error("Support for CPUs different from AARCH64, S390x,"
+                            + " SPARC, X86, and PPC is not implemented");
         }
     }
 
--- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java	Fri Jun 22 15:58:32 2018 -0700
+++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java	Fri Jun 22 16:11:36 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,8 +31,8 @@
 import jdk.test.lib.cli.predicate.OrPredicate;
 
 /**
- * Generic test case for SHA-related options targeted to non-x86 and
- * non-SPARC CPUs.
+ * Generic test case for SHA-related options targeted to any CPU except
+ * AArch64, S390x, SPARC and X86.
  */
 public class GenericTestCaseForOtherCPU extends
         SHAOptionsBase.TestCase {
@@ -43,7 +43,8 @@
                               new OrPredicate(Platform::isS390x,
                               new OrPredicate(Platform::isSparc,
                               new OrPredicate(Platform::isPPC,
-                              new OrPredicate(Platform::isX64, Platform::isX86)))))));
+                              new OrPredicate(Platform::isX64,
+                                              Platform::isX86)))))));
     }
 
     @Override
--- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java	Fri Jun 22 15:58:32 2018 -0700
+++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java	Fri Jun 22 16:11:36 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,10 +37,7 @@
 public class GenericTestCaseForSupportedCPU extends
         SHAOptionsBase.TestCase {
     public GenericTestCaseForSupportedCPU(String optionName) {
-        super(optionName,
-                new AndPredicate(
-                    new OrPredicate(Platform::isSparc, Platform::isAArch64),
-                    SHAOptionsBase.getPredicateForOption(optionName)));
+        super(optionName, SHAOptionsBase.getPredicateForOption(optionName));
     }
 
     @Override
--- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java	Fri Jun 22 15:58:32 2018 -0700
+++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java	Fri Jun 22 16:11:36 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,25 +33,22 @@
 import jdk.test.lib.cli.predicate.OrPredicate;
 
 /**
- * Test case specific to UseSHA*Intrinsics options targeted to SPARC and AArch64
- * CPUs which don't support required instruction, but support other SHA-related
+ * Test case specific to UseSHA*Intrinsics options targeted to CPUs
+ * which don't support required instruction, but support other SHA-related
  * instructions.
  *
- * For example, CPU support sha1 instruction, but don't support sha256 or
+ * For example, CPU supports sha1 instruction, but doesn't support sha256 or
  * sha512.
  */
 public class UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU
         extends SHAOptionsBase.TestCase {
     public UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU(
             String optionName) {
-        // execute test case on SPARC CPU that support any sha* instructions,
+        // execute test case on CPU that supports any sha* instructions,
         // but does not support sha* instruction required by the tested option.
         super(optionName, new AndPredicate(
-                new OrPredicate(Platform::isSparc, Platform::isAArch64),
-                new AndPredicate(
-                        IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE,
-                        new NotPredicate(SHAOptionsBase.getPredicateForOption(
-                                optionName)))));
+                IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE,
+                new NotPredicate(SHAOptionsBase.getPredicateForOption(optionName))));
     }
     @Override
     protected void verifyWarnings() throws Throwable {
--- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java	Fri Jun 22 15:58:32 2018 -0700
+++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java	Fri Jun 22 16:11:36 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,15 +33,13 @@
 import jdk.test.lib.cli.predicate.OrPredicate;
 
 /**
- * UseSHA specific test case targeted to SPARC and AArch64 CPUs which
- * support any sha* instruction.
+ * UseSHA specific test case targeted to CPUs which support any sha* instruction.
  */
 public class UseSHASpecificTestCaseForSupportedCPU
         extends SHAOptionsBase.TestCase {
     public UseSHASpecificTestCaseForSupportedCPU(String optionName) {
-        super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(
-                new OrPredicate(Platform::isSparc, Platform::isAArch64),
-                IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));
+        super(SHAOptionsBase.USE_SHA_OPTION,
+              IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE);
 
         Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
                 String.format("Test case should be used for '%s' option only.",
--- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java	Fri Jun 22 15:58:32 2018 -0700
+++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java	Fri Jun 22 16:11:36 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,16 +34,14 @@
 import jdk.test.lib.cli.predicate.OrPredicate;
 
 /**
- * UseSHA specific test case targeted to SPARC and AArch64 CPUs which don't
- * support all sha* instructions./
+ * UseSHA specific test case targeted to CPUs which don't support all
+ * sha* instructions.
  */
 public class UseSHASpecificTestCaseForUnsupportedCPU
         extends SHAOptionsBase.TestCase {
     public UseSHASpecificTestCaseForUnsupportedCPU(String optionName) {
-        super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(
-                new OrPredicate(Platform::isSparc, Platform::isAArch64),
-                new NotPredicate(
-                        IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE)));
+        super(SHAOptionsBase.USE_SHA_OPTION, new NotPredicate(
+                IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));
 
         Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
                 "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION