提交 71d2d0ca 编写于 作者: S sgehwolf

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

Summary: Others fail because of uncommon trap. Also fix test file names.
Reviewed-by: roland, andrew

--HG--
rename : test/compiler/intrinsics/bmi/verifycode/AddnTestI.java => test/compiler/intrinsics/bmi/verifycode/AndnTestI.java
rename : test/compiler/intrinsics/bmi/verifycode/AddnTestL.java => test/compiler/intrinsics/bmi/verifycode/AndnTestL.java
上级 c0c5c939
......@@ -58,15 +58,27 @@ public class TestAndnI {
}
public int intExpr(int src1, Expr.MemI src2) {
if (src2 != null) {
return ~src1 & src2.value;
} else {
return 0;
}
}
public int intExpr(Expr.MemI src1, int src2) {
if (src1 != null) {
return ~src1.value & src2;
} else {
return 0;
}
}
public int intExpr(Expr.MemI src1, Expr.MemI src2) {
if (src1 != null && src2 != null) {
return ~src1.value & src2.value;
} else {
return 0;
}
}
}
......@@ -77,15 +89,27 @@ public class TestAndnI {
}
public int intExpr(int src1, Expr.MemI src2) {
if (src2 != null) {
return src1 & ~src2.value;
} else {
return 0;
}
}
public int intExpr(Expr.MemI src1, int src2) {
if (src1 != null) {
return src1.value & ~src2;
} else {
return 0;
}
}
public int intExpr(Expr.MemI src1, Expr.MemI src2) {
if (src1 != null && src2 != null) {
return src1.value & ~src2.value;
} else {
return 0;
}
}
}
}
......@@ -58,15 +58,27 @@ public class TestAndnL {
}
public long longExpr(long src1, Expr.MemL src2) {
if (src2 != null) {
return ~src1 & src2.value;
} else {
return 0;
}
}
public long longExpr(Expr.MemL src1, long src2) {
if (src1 != null) {
return ~src1.value & src2;
} else {
return 0;
}
}
public long longExpr(Expr.MemL src1, Expr.MemL src2) {
if (src1 != null && src2 != null) {
return ~src1.value & src2.value;
} else {
return 0;
}
}
......@@ -79,15 +91,27 @@ public class TestAndnL {
}
public long longExpr(long src1, Expr.MemL src2) {
if (src2 != null) {
return src1 & ~src2.value;
} else {
return 0;
}
}
public long longExpr(Expr.MemL src1, long src2) {
if (src1 != null) {
return src1.value & ~src2;
} else {
return 0;
}
}
public long longExpr(Expr.MemL src1, Expr.MemL src2) {
if (src1 != null && src2 != null) {
return src1.value & ~src2.value;
} else {
return 0;
}
}
}
......
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. 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
......@@ -25,17 +25,17 @@
* @test
* @bug 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build AddnTestI
* @build AndnTestI
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestI
* -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[]{
......@@ -51,7 +51,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());
}
}
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. 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
......@@ -25,23 +25,23 @@
* @test
* @bug 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build AddnTestL
* @build AndnTestL
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestL
* -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());
}
}
......@@ -44,6 +44,8 @@ public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase {
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());
}
......
......@@ -49,6 +49,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());
}
}
......@@ -44,6 +44,8 @@ public class TZcntTestI extends BmiIntrinsicBase.BmiTestCase {
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());
}
......
......@@ -50,6 +50,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());
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册