< prev index next >

test/compiler/codegen/BitTests.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke

*** 23,39 **** /* * @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 * */ // 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. --- 23,44 ---- /* * @test * @bug 8144028 * @summary Use AArch64 bit-test instructions in C2 * + * @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,58 **** private final int increment(int ctr) { return ctr + 1; } private final long testIntSignedBranch(long counter) { ! if ((int)r.nextLong() < 0) { counter = increment(counter); } return counter; } --- 53,63 ---- private final int increment(int ctr) { return ctr + 1; } private final long testIntSignedBranch(long counter) { ! if ((int) r.nextLong() < 0) { counter = increment(counter); } return counter; }
*** 62,75 **** } return counter; } private final long testIntBitBranch(long counter) { ! if (((int)r.nextLong() & (1 << 27)) != 0) { counter = increment(counter); } ! if (((int)r.nextLong() & (1 << 27)) != 0) { counter = increment(counter); } return counter; } --- 67,80 ---- } return counter; } private final long testIntBitBranch(long counter) { ! if (((int) r.nextLong() & (1 << 27)) != 0) { counter = increment(counter); } ! if (((int) r.nextLong() & (1 << 27)) != 0) { counter = increment(counter); } return counter; }
*** 89,99 **** } return counter; } private final long testIntMaskBranch(long counter) { ! if ((((int)r.nextLong() & 0x08) != 0)) { counter++; } return counter; } --- 94,104 ---- } return counter; } private final long testIntMaskBranch(long counter) { ! if ((((int) r.nextLong() & 0x08) != 0)) { counter++; } return counter; }
*** 103,113 **** } return counter; } private final long testIntMaskBranch(long counter, int mask) { ! if ((((int)r.nextLong() & mask) != 0)) { counter++; } return counter; } --- 108,118 ---- } return counter; } private final long testIntMaskBranch(long counter, int mask) { ! if ((((int) r.nextLong() & mask) != 0)) { counter++; } return counter; }
*** 140,156 **** 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. - class XorShift { - private long y; XorShift() { y = 2463534242l; } --- 145,159 ---- 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 { private long y; XorShift() { y = 2463534242l; }
*** 159,164 **** --- 162,168 ---- y ^= (y << 13); y ^= (y >>> 17); return (y ^= (y << 5)); } + } }
< prev index next >