Merge
authorthartmann
Thu, 21 May 2015 18:57:21 +0200
changeset 30763 8db0ca821362
parent 30755 60481f3d4bd6 (current diff)
parent 30762 f169e79dc011 (diff)
child 30773 3f15e2dc056b
child 30775 7ef17210a4b4
Merge
--- a/hotspot/src/cpu/ppc/vm/ppc.ad	Tue May 19 14:13:15 2015 +0300
+++ b/hotspot/src/cpu/ppc/vm/ppc.ad	Thu May 21 18:57:21 2015 +0200
@@ -2173,9 +2173,8 @@
 
 // Do we need to mask the count passed to shift instructions or does
 // the cpu only look at the lower 5/6 bits anyway?
-// Off, as masks are generated in expand rules where required.
-// Constant shift counts are handled in Ideal phase.
-const bool Matcher::need_masked_shift_count = false;
+// PowerPC requires masked shift counts.
+const bool Matcher::need_masked_shift_count = true;
 
 // This affects two different things:
 //  - how Decode nodes are matched
--- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp	Tue May 19 14:13:15 2015 +0300
+++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp	Thu May 21 18:57:21 2015 +0200
@@ -79,7 +79,7 @@
 // GC Ergo Flags
 define_pd_global(size_t, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
 
-define_pd_global(uintx, TypeProfileLevel, 0);
+define_pd_global(uintx, TypeProfileLevel, 111);
 
 #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \
                                                                             \
--- a/hotspot/src/cpu/zero/vm/globals_zero.hpp	Tue May 19 14:13:15 2015 +0300
+++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp	Thu May 21 18:57:21 2015 +0200
@@ -61,6 +61,8 @@
 
 define_pd_global(uintx, TypeProfileLevel, 0);
 
+define_pd_global(bool, PreserveFramePointer, false);
+
 #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct)  \
   product(bool, UseFastEmptyMethods, true,                                  \
           "Use fast method entry code for empty methods")                   \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/codegen/IntRotateWithImmediate.java	Thu May 21 18:57:21 2015 +0200
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2015 SAP AG.  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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8080190
+ * @key regression
+ * @summary Test that the rotate distance used in the rotate instruction is properly masked with 0x1f
+ * @run main/othervm -Xbatch -XX:-UseOnStackReplacement IntRotateWithImmediate
+ * @author volker.simonis@gmail.com
+ */
+
+public class IntRotateWithImmediate {
+
+  // This is currently the same as Integer.rotateRight()
+  static int rotateRight(int i, int distance) {
+    // On some architectures (i.e. x86_64 and ppc64) the following computation is
+    // matched in the .ad file into a single MachNode which emmits a single rotate
+    // machine instruction. It is important that the shift amount is masked to match
+    // corresponding immediate width in the native instruction. On x86_64 the rotate
+    // left instruction ('rol') encodes an 8-bit immediate while the corresponding
+    // 'rotlwi' instruction on Power only encodes a 5-bit immediate.
+    return ((i >>> distance) | (i << -distance));
+  }
+
+  static int compute(int x) {
+    return rotateRight(x, 3);
+  }
+
+  public static void main(String args[]) {
+    int val = 4096;
+
+    int firstResult = compute(val);
+
+    for (int i = 0; i < 100000; i++) {
+      int newResult = compute(val);
+      if (firstResult != newResult) {
+        throw new InternalError(firstResult + " != " + newResult);
+      }
+    }
+    System.out.println("OK");
+  }
+
+}
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java	Tue May 19 14:13:15 2015 +0300
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java	Thu May 21 18:57:21 2015 +0200
@@ -129,7 +129,8 @@
 
         @Override
         protected boolean isIntrinsicSupported() {
-            return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) && (Platform.isX86() || Platform.isX64());
+            return isServerVM() && Boolean.valueOf(useMathExactIntrinsics)
+                && (Platform.isX86() || Platform.isX64() || Platform.isAArch64());
         }
 
         @Override
@@ -146,7 +147,7 @@
         @Override
         protected boolean isIntrinsicSupported() {
             return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) &&
-                (Platform.isX64() || Platform.isPPC());
+                (Platform.isX64() || Platform.isPPC() || Platform.isAArch64());
         }
 
         @Override
--- a/hotspot/test/compiler/loopopts/superword/SumRed_Long.java	Tue May 19 14:13:15 2015 +0300
+++ b/hotspot/test/compiler/loopopts/superword/SumRed_Long.java	Thu May 21 18:57:21 2015 +0200
@@ -27,11 +27,11 @@
  * @bug 8076276
  * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : long test
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Long
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Long
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Long
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Long
  *
  */
 
--- a/hotspot/test/test_env.sh	Tue May 19 14:13:15 2015 +0300
+++ b/hotspot/test/test_env.sh	Thu May 21 18:57:21 2015 +0200
@@ -198,6 +198,11 @@
 then
   VM_CPU="ia64"
 fi
+grep "aarch64" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_CPU="aarch64"
+fi
 export VM_TYPE VM_BITS VM_OS VM_CPU
 echo "VM_TYPE=${VM_TYPE}"
 echo "VM_BITS=${VM_BITS}"
--- a/hotspot/test/testlibrary/jdk/test/lib/Platform.java	Tue May 19 14:13:15 2015 +0300
+++ b/hotspot/test/testlibrary/jdk/test/lib/Platform.java	Thu May 21 18:57:21 2015 +0200
@@ -132,6 +132,10 @@
         return isArch("(amd64)|(x86_64)");
     }
 
+    public static boolean isAArch64() {
+        return isArch("aarch64");
+    }
+
     private static boolean isArch(String archnameRE) {
         return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE)
                 .matcher(osArch)
--- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java	Tue May 19 14:13:15 2015 +0300
+++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java	Thu May 21 18:57:21 2015 +0200
@@ -45,7 +45,7 @@
  */
 public class TestMutuallyExclusivePlatformPredicates {
     private static enum MethodGroup {
-        ARCH("isARM", "isPPC", "isSparc", "isX86", "isX64"),
+        ARCH("isARM", "isPPC", "isSparc", "isX86", "isX64", "isAArch64"),
         BITNESS("is32bit", "is64bit"),
         OS("isAix", "isLinux", "isOSX", "isSolaris", "isWindows"),
         VM_TYPE("isClient", "isServer", "isGraal", "isMinimal", "isZero"),