From 49ab7a3900abec6d98b3536fd0928b574147e3ed Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Fri, 15 May 2015 18:12:21 -0700 Subject: [PATCH 1/6] 8080483: Incorrect test execution string at SumRed_Long.java Reviewed-by: iveresov --- hotspot/test/compiler/loopopts/superword/SumRed_Long.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hotspot/test/compiler/loopopts/superword/SumRed_Long.java b/hotspot/test/compiler/loopopts/superword/SumRed_Long.java index 1f504a8ef52..c11b6275f1c 100644 --- a/hotspot/test/compiler/loopopts/superword/SumRed_Long.java +++ b/hotspot/test/compiler/loopopts/superword/SumRed_Long.java @@ -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 * */ From f5c1e4d57635b17962ed4a66512c83d41f0d2483 Mon Sep 17 00:00:00 2001 From: Zoltan Majo Date: Mon, 18 May 2015 19:54:49 +0200 Subject: [PATCH 2/6] 8080281: 8068945 changes break building the zero JVM variant Define the PreserveFramePointer flag also in globals_zero.hpp Reviewed-by: simonis, kvn, sgehwolf --- hotspot/src/cpu/zero/vm/globals_zero.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hotspot/src/cpu/zero/vm/globals_zero.hpp b/hotspot/src/cpu/zero/vm/globals_zero.hpp index 9e2020ea159..1f7a4f87114 100644 --- a/hotspot/src/cpu/zero/vm/globals_zero.hpp +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp @@ -61,6 +61,8 @@ define_pd_global(size_t, CMSYoungGenPerWorker, 16*M); // default max size of CM 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") \ From b48a61e5be7f3a00268e1d6a369d307857664219 Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Tue, 19 May 2015 11:06:34 +0200 Subject: [PATCH 3/6] 8080190: PPC64: Fix wrong rotate instructions in the .ad file Reviewed-by: kvn --- hotspot/src/cpu/ppc/vm/ppc.ad | 5 +- .../codegen/IntRotateWithImmediate.java | 64 +++++++++++++++++++ 2 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 hotspot/test/compiler/codegen/IntRotateWithImmediate.java diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 388b102ee11..b4264973cb3 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -2173,9 +2173,8 @@ const bool Matcher::clone_shift_expressions = false; // 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 diff --git a/hotspot/test/compiler/codegen/IntRotateWithImmediate.java b/hotspot/test/compiler/codegen/IntRotateWithImmediate.java new file mode 100644 index 00000000000..1d617a41526 --- /dev/null +++ b/hotspot/test/compiler/codegen/IntRotateWithImmediate.java @@ -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"); + } + +} From 7c62a26e6bdb7157944c13c766203499844dd3d3 Mon Sep 17 00:00:00 2001 From: Shrinivas Joshi Date: Tue, 19 May 2015 16:05:12 +0200 Subject: [PATCH 4/6] 8080308: TypeProfileLevel on SPARC platform should enable JSR292-only profiling level Set TypeProfileLevel to 111 by default on sparc Reviewed-by: kvn, roland --- hotspot/src/cpu/sparc/vm/globals_sparc.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp index 800e6ef5a74..2c3424c0699 100644 --- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp @@ -79,7 +79,7 @@ define_pd_global(bool, PreserveFramePointer, false); // 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) \ \ From d917a8866cc18451f854b6b7bf1a890ffc6b7e46 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Wed, 20 May 2015 10:21:02 +0100 Subject: [PATCH 5/6] 8080600: AARCH64: testlibrary does not support AArch64 Add Platform.isAArch64(). Use it in mathexact intrinsic tests. Reviewed-by: kvn, roland --- .../compiler/intrinsics/mathexact/sanity/IntrinsicBase.java | 5 +++-- hotspot/test/testlibrary/jdk/test/lib/Platform.java | 4 ++++ .../TestMutuallyExclusivePlatformPredicates.java | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java index 499de7fb181..f98f5926f1b 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java @@ -129,7 +129,8 @@ public abstract class IntrinsicBase extends CompilerWhiteBoxTest { @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 @@ public abstract class IntrinsicBase extends CompilerWhiteBoxTest { @Override protected boolean isIntrinsicSupported() { return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) && - (Platform.isX64() || Platform.isPPC()); + (Platform.isX64() || Platform.isPPC() || Platform.isAArch64()); } @Override diff --git a/hotspot/test/testlibrary/jdk/test/lib/Platform.java b/hotspot/test/testlibrary/jdk/test/lib/Platform.java index 05290e5d878..ec1cbe82114 100644 --- a/hotspot/test/testlibrary/jdk/test/lib/Platform.java +++ b/hotspot/test/testlibrary/jdk/test/lib/Platform.java @@ -132,6 +132,10 @@ public class Platform { 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) diff --git a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java index b3e220ee37e..ecd9ec08469 100644 --- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java +++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java @@ -45,7 +45,7 @@ import java.util.Set; */ 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"), From 265b75c58454f9900f5f46489526663348b68ea1 Mon Sep 17 00:00:00 2001 From: Sergei Kovalev Date: Wed, 20 May 2015 09:07:36 -0400 Subject: [PATCH 6/6] 8078834: [TESTBUG] Tests fails on ARM64 due to unknown hardware Reviewed-by: dholmes, adinn --- hotspot/test/test_env.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hotspot/test/test_env.sh b/hotspot/test/test_env.sh index a6f1ba39dcb..660776e2221 100644 --- a/hotspot/test/test_env.sh +++ b/hotspot/test/test_env.sh @@ -198,6 +198,11 @@ if [ $? = 0 ] 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}"