< prev index next >
test/compiler/codegen/BitTests.java
Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke
@@ -23,17 +23,22 @@
/*
* @test
* @bug 8144028
* @summary Use AArch64 bit-test instructions in C2
- * @modules java.base
- * @run main/othervm -Xbatch -XX:CompileCommand=dontinline,BitTests::* -XX:-TieredCompilation BitTests
- * @run main/othervm -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=1 BitTests
- * @run main/othervm -Xbatch -XX:+TieredCompilation BitTests
*
+ * @run main/othervm -Xbatch -XX:-TieredCompilation
+ * -XX:CompileCommand=dontinline,compiler.codegen.BitTests::*
+ * compiler.codegen.BitTests
+ * @run main/othervm -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * compiler.codegen.BitTests
+ * @run main/othervm -Xbatch -XX:+TieredCompilation
+ * compiler.codegen.BitTests
*/
+package compiler.codegen;
+
// Try to ensure that the bit test instructions TBZ/TBNZ, TST/TSTW
// don't generate incorrect code. We can't guarantee that C2 will use
// bit test instructions for this test and it's not a bug if it
// doesn't. However, these test cases are ideal candidates for each
// of the instruction forms.
@@ -48,11 +53,11 @@
private final int increment(int ctr) {
return ctr + 1;
}
private final long testIntSignedBranch(long counter) {
- if ((int)r.nextLong() < 0) {
+ if ((int) r.nextLong() < 0) {
counter = increment(counter);
}
return counter;
}
@@ -62,14 +67,14 @@
}
return counter;
}
private final long testIntBitBranch(long counter) {
- if (((int)r.nextLong() & (1 << 27)) != 0) {
+ if (((int) r.nextLong() & (1 << 27)) != 0) {
counter = increment(counter);
}
- if (((int)r.nextLong() & (1 << 27)) != 0) {
+ if (((int) r.nextLong() & (1 << 27)) != 0) {
counter = increment(counter);
}
return counter;
}
@@ -89,11 +94,11 @@
}
return counter;
}
private final long testIntMaskBranch(long counter) {
- if ((((int)r.nextLong() & 0x08) != 0)) {
+ if ((((int) r.nextLong() & 0x08) != 0)) {
counter++;
}
return counter;
}
@@ -103,11 +108,11 @@
}
return counter;
}
private final long testIntMaskBranch(long counter, int mask) {
- if ((((int)r.nextLong() & mask) != 0)) {
+ if ((((int) r.nextLong() & mask) != 0)) {
counter++;
}
return counter;
}
@@ -140,17 +145,15 @@
System.exit(97);
}
System.out.println("PASSED");
}
-}
+ // Marsaglia's xor-shift generator, used here because it is
+ // reproducible across all Java implementations. It is also very
+ // fast.
+ static class XorShift {
-// Marsaglia's xor-shift generator, used here because it is
-// reproducible across all Java implementations. It is also very
-// fast.
-class XorShift {
-
private long y;
XorShift() {
y = 2463534242l;
}
@@ -159,6 +162,7 @@
y ^= (y << 13);
y ^= (y >>> 17);
return (y ^= (y << 5));
}
+ }
}
< prev index next >