8134579: [TESTBUG] Some bmi tests fail if can_access_local_variables is on

Others fail because of uncommon trap. Also fix test file names.

Reviewed-by: vlivanov
This commit is contained in:
Goetz Lindenmaier 2015-09-18 13:41:24 +02:00
parent f620878faf
commit dd76bcc4c2
8 changed files with 82 additions and 26 deletions

View File

@ -61,15 +61,27 @@ public class TestAndnI {
}
public int intExpr(int src1, Expr.MemI src2) {
return ~src1 & src2.value;
if (src2 != null) {
return ~src1 & src2.value;
} else {
return 0;
}
}
public int intExpr(Expr.MemI src1, int src2) {
return ~src1.value & src2;
if (src1 != null) {
return ~src1.value & src2;
} else {
return 0;
}
}
public int intExpr(Expr.MemI src1, Expr.MemI src2) {
return ~src1.value & src2.value;
if (src1 != null && src2 != null) {
return ~src1.value & src2.value;
} else {
return 0;
}
}
}
@ -80,15 +92,27 @@ public class TestAndnI {
}
public int intExpr(int src1, Expr.MemI src2) {
return src1 & ~src2.value;
if (src2 != null) {
return src1 & ~src2.value;
} else {
return 0;
}
}
public int intExpr(Expr.MemI src1, int src2) {
return src1.value & ~src2;
if (src1 != null) {
return src1.value & ~src2;
} else {
return 0;
}
}
public int intExpr(Expr.MemI src1, Expr.MemI src2) {
return src1.value & ~src2.value;
if (src1 != null && src2 != null) {
return src1.value & ~src2.value;
} else {
return 0;
}
}
}
}

View File

@ -61,15 +61,27 @@ public class TestAndnL {
}
public long longExpr(long src1, Expr.MemL src2) {
return ~src1 & src2.value;
if (src2 != null) {
return ~src1 & src2.value;
} else {
return 0;
}
}
public long longExpr(Expr.MemL src1, long src2) {
return ~src1.value & src2;
if (src1 != null) {
return ~src1.value & src2;
} else {
return 0;
}
}
public long longExpr(Expr.MemL src1, Expr.MemL src2) {
return ~src1.value & src2.value;
if (src1 != null && src2 != null) {
return ~src1.value & src2.value;
} else {
return 0;
}
}
@ -82,15 +94,27 @@ public class TestAndnL {
}
public long longExpr(long src1, Expr.MemL src2) {
return src1 & ~src2.value;
if (src2 != null) {
return src1 & ~src2.value;
} else {
return 0;
}
}
public long longExpr(Expr.MemL src1, long src2) {
return src1.value & ~src2;
if (src1 != null) {
return src1.value & ~src2;
} else {
return 0;
}
}
public long longExpr(Expr.MemL src1, Expr.MemL src2) {
return src1.value & ~src2.value;
if (src1 != null && src2 != null) {
return src1.value & ~src2.value;
} else {
return 0;
}
}
}

View File

@ -27,18 +27,18 @@
* @library /testlibrary /test/lib /compiler/whitebox / ..
* @modules java.base/sun.misc
* java.management
* @build AddnTestI
* @build AndnTestI
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestI
* @run main/bootclasspath -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AndnTestI
*/
import java.lang.reflect.Method;
public class AddnTestI extends BmiIntrinsicBase.BmiTestCase {
public class AndnTestI extends BmiIntrinsicBase.BmiTestCase {
protected AddnTestI(Method method) {
protected AndnTestI(Method method) {
super(method);
// from intel manual VEX.NDS.LZ.0F38.W0 F2 /r, example c4e260f2c2
instrMask = new byte[]{
@ -54,7 +54,7 @@ public class AddnTestI extends BmiIntrinsicBase.BmiTestCase {
}
public static void main(String[] args) throws Exception {
BmiIntrinsicBase.verifyTestCase(AddnTestI::new, TestAndnI.AndnIExpr.class.getDeclaredMethods());
BmiIntrinsicBase.verifyTestCase(AddnTestI::new, TestAndnI.AndnICommutativeExpr.class.getDeclaredMethods());
BmiIntrinsicBase.verifyTestCase(AndnTestI::new, TestAndnI.AndnIExpr.class.getDeclaredMethods());
BmiIntrinsicBase.verifyTestCase(AndnTestI::new, TestAndnI.AndnICommutativeExpr.class.getDeclaredMethods());
}
}

View File

@ -27,24 +27,24 @@
* @library /testlibrary /test/lib /compiler/whitebox / ..
* @modules java.base/sun.misc
* java.management
* @build AddnTestL
* @build AndnTestL
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestL
* @run main/bootclasspath -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AndnTestL
*/
import java.lang.reflect.Method;
public class AddnTestL extends AddnTestI {
public class AndnTestL extends AndnTestI {
protected AddnTestL(Method method) {
protected AndnTestL(Method method) {
super(method);
isLongOperation = true;
}
public static void main(String[] args) throws Exception {
BmiIntrinsicBase.verifyTestCase(AddnTestL::new, TestAndnL.AndnLExpr.class.getDeclaredMethods());
BmiIntrinsicBase.verifyTestCase(AddnTestL::new, TestAndnL.AndnLCommutativeExpr.class.getDeclaredMethods());
BmiIntrinsicBase.verifyTestCase(AndnTestL::new, TestAndnL.AndnLExpr.class.getDeclaredMethods());
BmiIntrinsicBase.verifyTestCase(AndnTestL::new, TestAndnL.AndnLCommutativeExpr.class.getDeclaredMethods());
}
}

View File

@ -50,6 +50,8 @@ public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase_x64 {
public static void main(String[] args) throws Exception {
// j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
System.out.println("class java.lang.Integer should be loaded. Proof: " + Integer.class);
// Avoid uncommon traps.
System.out.println("Num leading zeroes: " + new TestLzcntI.LzcntIExpr().intExpr(12341341));
BmiIntrinsicBase.verifyTestCase(LZcntTestI::new, TestLzcntI.LzcntIExpr.class.getDeclaredMethods());
}

View File

@ -46,6 +46,8 @@ public class LZcntTestL extends LZcntTestI {
public static void main(String[] args) throws Exception {
// j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
System.out.println("classes java.lang.Long should be loaded. Proof: " + Long.class);
// Avoid uncommon traps.
System.out.println("Num leading zeroes: " + new TestLzcntL.LzcntLExpr().longExpr(12341341));
BmiIntrinsicBase.verifyTestCase(LZcntTestL::new, TestLzcntL.LzcntLExpr.class.getDeclaredMethods());
}
}

View File

@ -50,6 +50,8 @@ public class TZcntTestI extends BmiIntrinsicBase.BmiTestCase_x64 {
public static void main(String[] args) throws Exception {
// j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
System.out.println("class java.lang.Integer should be loaded. Proof: " + Integer.class);
// Avoid uncommon traps.
System.out.println("Num trailing zeroes: " + new TestTzcntI.TzcntIExpr().intExpr(12341341));
BmiIntrinsicBase.verifyTestCase(TZcntTestI::new, TestTzcntI.TzcntIExpr.class.getDeclaredMethods());
}

View File

@ -46,6 +46,8 @@ public class TZcntTestL extends TZcntTestI {
public static void main(String[] args) throws Exception {
// j.l.Integer and Long should be loaded to allow a compilation of the methods that use their methods
System.out.println("classes java.lang.Long should be loaded. Proof: " + Long.class);
// Avoid uncommon traps.
System.out.println("Num trailing zeroes: " + new TestTzcntL.TzcntLExpr().longExpr(12341341));
BmiIntrinsicBase.verifyTestCase(TZcntTestL::new, TestTzcntL.TzcntLExpr.class.getDeclaredMethods());
}
}