Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
c528227d
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c528227d
编写于
4月 11, 2014
作者:
I
iignatyev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8038953: Add sanity tests for BMI1 and LZCNT instructions
Reviewed-by: kvn, iignatyev Contributed-by: anton.ivanov@oracle.com
上级
0a8699c4
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
851 addition
and
1 deletion
+851
-1
test/TEST.groups
test/TEST.groups
+2
-1
test/compiler/intrinsics/bmi/verifycode/AddnTestI.java
test/compiler/intrinsics/bmi/verifycode/AddnTestI.java
+57
-0
test/compiler/intrinsics/bmi/verifycode/AddnTestL.java
test/compiler/intrinsics/bmi/verifycode/AddnTestL.java
+47
-0
test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java
test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java
+59
-0
test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java
test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java
+47
-0
test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java
test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java
+59
-0
test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java
test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java
+47
-0
test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java
test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java
+59
-0
test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java
test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java
+47
-0
test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
.../compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
+186
-0
test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
+59
-0
test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
+54
-0
test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
+54
-0
test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
+55
-0
test/testlibrary/com/oracle/java/testlibrary/Utils.java
test/testlibrary/com/oracle/java/testlibrary/Utils.java
+19
-0
未找到文件。
test/TEST.groups
浏览文件 @
c528227d
...
...
@@ -135,7 +135,8 @@ needs_compact3 = \
runtime/InternalApi/ThreadCpuTimesDeadlock.java \
serviceability/threads/TestFalseDeadLock.java \
compiler/tiered/NonTieredLevelsTest.java \
compiler/tiered/TieredLevelsTest.java
compiler/tiered/TieredLevelsTest.java \
compiler/intrinsics/bmi/verifycode
# Compact 2 adds full VM tests
compact2 = \
...
...
test/compiler/intrinsics/bmi/verifycode/AddnTestI.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build AddnTestI
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestI
*/
import
java.lang.reflect.Method
;
public
class
AddnTestI
extends
BmiIntrinsicBase
.
BmiTestCase
{
protected
AddnTestI
(
Method
method
)
{
super
(
method
);
// from intel manual VEX.NDS.LZ.0F38.W0 F2 /r, example c4e260f2c2
instrMask
=
new
byte
[]{
(
byte
)
0xFF
,
(
byte
)
0x1F
,
(
byte
)
0x00
,
(
byte
)
0xFF
};
instrPattern
=
new
byte
[]{
(
byte
)
0xC4
,
// prefix for 3-byte VEX instruction
(
byte
)
0x02
,
// 00010 implied 0F 38 leading opcode bytes
(
byte
)
0x00
,
(
byte
)
0xF2
};
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
BmiIntrinsicBase
.
verifyTestCase
(
AddnTestI:
:
new
,
TestAndnI
.
AndnIExpr
.
class
.
getDeclaredMethods
());
BmiIntrinsicBase
.
verifyTestCase
(
AddnTestI:
:
new
,
TestAndnI
.
AndnICommutativeExpr
.
class
.
getDeclaredMethods
());
}
}
test/compiler/intrinsics/bmi/verifycode/AddnTestL.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build AddnTestL
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AddnTestL
*/
import
java.lang.reflect.Method
;
public
class
AddnTestL
extends
AddnTestI
{
protected
AddnTestL
(
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
());
}
}
test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build BlsiTestI
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsiTestI
*/
import
java.lang.reflect.Method
;
public
class
BlsiTestI
extends
BmiIntrinsicBase
.
BmiTestCase
{
protected
BlsiTestI
(
Method
method
)
{
super
(
method
);
//from intel manual VEX.NDD.LZ.0F38.W0 F3 /3
instrMask
=
new
byte
[]{
(
byte
)
0xFF
,
(
byte
)
0x1F
,
(
byte
)
0x00
,
(
byte
)
0xFF
,
(
byte
)
0b0011_1000
};
instrPattern
=
new
byte
[]{
(
byte
)
0xC4
,
// prefix for 3-byte VEX instruction
(
byte
)
0x02
,
// 00010 implied 0F 38 leading opcode bytes
(
byte
)
0x00
,
(
byte
)
0xF3
,
(
byte
)
0b0001_1000
};
// bits 543 == 011 (3)
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
BmiIntrinsicBase
.
verifyTestCase
(
BlsiTestI:
:
new
,
TestBlsiI
.
BlsiIExpr
.
class
.
getDeclaredMethods
());
BmiIntrinsicBase
.
verifyTestCase
(
BlsiTestI:
:
new
,
TestBlsiI
.
BlsiICommutativeExpr
.
class
.
getDeclaredMethods
());
}
}
test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build BlsiTestL
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsiTestL
*/
import
java.lang.reflect.Method
;
public
class
BlsiTestL
extends
BlsiTestI
{
protected
BlsiTestL
(
Method
method
)
{
super
(
method
);
isLongOperation
=
true
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
BmiIntrinsicBase
.
verifyTestCase
(
BlsiTestL:
:
new
,
TestBlsiL
.
BlsiLExpr
.
class
.
getDeclaredMethods
());
BmiIntrinsicBase
.
verifyTestCase
(
BlsiTestL:
:
new
,
TestBlsiL
.
BlsiLCommutativeExpr
.
class
.
getDeclaredMethods
());
}
}
test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build BlsmskTestI
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsmskTestI
*/
import
java.lang.reflect.Method
;
public
class
BlsmskTestI
extends
BmiIntrinsicBase
.
BmiTestCase
{
protected
BlsmskTestI
(
Method
method
)
{
super
(
method
);
//from intel manual VEX.NDD.LZ.0F38.W0 F3 /2
instrMask
=
new
byte
[]{
(
byte
)
0xFF
,
(
byte
)
0x1F
,
(
byte
)
0x00
,
(
byte
)
0xFF
,
(
byte
)
0b0011_1000
};
instrPattern
=
new
byte
[]{
(
byte
)
0xC4
,
// prefix for 3-byte VEX instruction
(
byte
)
0x02
,
// 00010 implied 0F 38 leading opcode bytes
(
byte
)
0x00
,
(
byte
)
0xF3
,
(
byte
)
0b0001_0000
};
// bits 543 == 011 (3)
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
BmiIntrinsicBase
.
verifyTestCase
(
BlsmskTestI:
:
new
,
TestBlsmskI
.
BlsmskIExpr
.
class
.
getDeclaredMethods
());
BmiIntrinsicBase
.
verifyTestCase
(
BlsmskTestI:
:
new
,
TestBlsmskI
.
BlsmskICommutativeExpr
.
class
.
getDeclaredMethods
());
}
}
test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build BlsmskTestL
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsmskTestL
*/
import
java.lang.reflect.Method
;
public
class
BlsmskTestL
extends
BlsmskTestI
{
protected
BlsmskTestL
(
Method
method
)
{
super
(
method
);
isLongOperation
=
true
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
BmiIntrinsicBase
.
verifyTestCase
(
BlsmskTestL:
:
new
,
TestBlsmskL
.
BlsmskLExpr
.
class
.
getDeclaredMethods
());
BmiIntrinsicBase
.
verifyTestCase
(
BlsmskTestL:
:
new
,
TestBlsmskL
.
BlsmskLCommutativeExpr
.
class
.
getDeclaredMethods
());
}
}
test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build BlsrTestI
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsrTestI
*/
import
java.lang.reflect.Method
;
public
class
BlsrTestI
extends
BmiIntrinsicBase
.
BmiTestCase
{
protected
BlsrTestI
(
Method
method
)
{
super
(
method
);
//from intel manual VEX.NDD.LZ.0F38.W0 F3 /1
instrMask
=
new
byte
[]{
(
byte
)
0xFF
,
(
byte
)
0x1F
,
(
byte
)
0x00
,
(
byte
)
0xFF
,
(
byte
)
0b0011_1000
};
instrPattern
=
new
byte
[]{
(
byte
)
0xC4
,
// prefix for 3-byte VEX instruction
(
byte
)
0x02
,
// 00010 implied 0F 38 leading opcode bytes
(
byte
)
0x00
,
(
byte
)
0xF3
,
(
byte
)
0b0000_1000
};
// bits 543 == 011 (3)
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
BmiIntrinsicBase
.
verifyTestCase
(
BlsrTestI:
:
new
,
TestBlsrI
.
BlsrIExpr
.
class
.
getDeclaredMethods
());
BmiIntrinsicBase
.
verifyTestCase
(
BlsrTestI:
:
new
,
TestBlsrI
.
BlsrICommutativeExpr
.
class
.
getDeclaredMethods
());
}
}
test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build BlsrTestL
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsrTestL
*/
import
java.lang.reflect.Method
;
public
class
BlsrTestL
extends
BlsrTestI
{
protected
BlsrTestL
(
Method
method
)
{
super
(
method
);
isLongOperation
=
true
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
BmiIntrinsicBase
.
verifyTestCase
(
BlsrTestL:
:
new
,
TestBlsrL
.
BlsrLExpr
.
class
.
getDeclaredMethods
());
BmiIntrinsicBase
.
verifyTestCase
(
BlsrTestL:
:
new
,
TestBlsrL
.
BlsrLCommutativeExpr
.
class
.
getDeclaredMethods
());
}
}
test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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.
*
*/
import
com.oracle.java.testlibrary.Asserts
;
import
com.oracle.java.testlibrary.Platform
;
import
com.oracle.java.testlibrary.Utils
;
import
sun.hotspot.code.NMethod
;
import
sun.hotspot.cpuinfo.CPUInfo
;
import
java.lang.reflect.Executable
;
import
java.lang.reflect.Method
;
import
java.util.concurrent.Callable
;
import
java.util.function.Function
;
public
class
BmiIntrinsicBase
extends
CompilerWhiteBoxTest
{
protected
BmiIntrinsicBase
(
BmiTestCase
testCase
)
{
super
(
testCase
);
}
public
static
void
verifyTestCase
(
Function
<
Method
,
BmiTestCase
>
constructor
,
Method
...
methods
)
throws
Exception
{
for
(
Method
method
:
methods
)
{
new
BmiIntrinsicBase
(
constructor
.
apply
(
method
)).
test
();
}
}
@Override
protected
void
test
()
throws
Exception
{
BmiTestCase
bmiTestCase
=
(
BmiTestCase
)
testCase
;
if
(!(
Platform
.
isX86
()
||
Platform
.
isX64
()))
{
System
.
out
.
println
(
"Unsupported platform, test SKIPPED"
);
return
;
}
if
(!
Platform
.
isServer
())
{
System
.
out
.
println
(
"Not server VM, test SKIPPED"
);
return
;
}
if
(!
CPUInfo
.
hasFeature
(
bmiTestCase
.
getCpuFlag
()))
{
System
.
out
.
println
(
"Unsupported hardware, no required CPU flag "
+
bmiTestCase
.
getCpuFlag
()
+
" , test SKIPPED"
);
return
;
}
if
(!
Boolean
.
valueOf
(
getVMOption
(
bmiTestCase
.
getVMFlag
())))
{
System
.
out
.
println
(
"VM flag "
+
bmiTestCase
.
getVMFlag
()
+
" disabled, test SKIPPED"
);
return
;
}
System
.
out
.
println
(
testCase
.
name
());
switch
(
MODE
)
{
case
"compiled mode"
:
case
"mixed mode"
:
if
(
TIERED_COMPILATION
&&
TIERED_STOP_AT_LEVEL
!=
CompilerWhiteBoxTest
.
COMP_LEVEL_MAX
)
{
System
.
out
.
println
(
"TieredStopAtLevel value ("
+
TIERED_STOP_AT_LEVEL
+
") is too low, test SKIPPED"
);
return
;
}
deoptimize
();
compileAtLevelAndCheck
(
CompilerWhiteBoxTest
.
COMP_LEVEL_MAX
);
break
;
case
"interpreted mode"
:
// test is not applicable in this mode;
System
.
err
.
println
(
"Warning: This test is not applicable in mode: "
+
MODE
);
break
;
default
:
throw
new
AssertionError
(
"Test bug, unknown VM mode: "
+
MODE
);
}
}
protected
void
compileAtLevelAndCheck
(
int
level
)
{
WHITE_BOX
.
enqueueMethodForCompilation
(
method
,
level
);
waitBackgroundCompilation
();
checkCompilation
(
method
,
level
);
checkEmittedCode
(
method
);
}
protected
void
checkCompilation
(
Executable
executable
,
int
level
)
{
if
(!
WHITE_BOX
.
isMethodCompiled
(
executable
))
{
throw
new
AssertionError
(
"Test bug, expected compilation (level): "
+
level
+
", but not compiled"
+
WHITE_BOX
.
isMethodCompilable
(
executable
,
level
));
}
final
int
compilationLevel
=
WHITE_BOX
.
getMethodCompilationLevel
(
executable
);
if
(
compilationLevel
!=
level
)
{
throw
new
AssertionError
(
"Test bug, expected compilation (level): "
+
level
+
", but level: "
+
compilationLevel
);
}
}
protected
void
checkEmittedCode
(
Executable
executable
)
{
final
byte
[]
nativeCode
=
NMethod
.
get
(
executable
,
false
).
insts
;
if
(!((
BmiTestCase
)
testCase
).
verifyPositive
(
nativeCode
))
{
throw
new
AssertionError
(
testCase
.
name
()
+
"CPU instructions expected not found: "
+
Utils
.
toHexString
(
nativeCode
));
}
else
{
System
.
out
.
println
(
"CPU instructions found, PASSED"
);
}
}
abstract
static
class
BmiTestCase
implements
CompilerWhiteBoxTest
.
TestCase
{
private
final
Method
method
;
protected
byte
[]
instrMask
;
protected
byte
[]
instrPattern
;
protected
boolean
isLongOperation
;
public
BmiTestCase
(
Method
method
)
{
this
.
method
=
method
;
}
@Override
public
String
name
()
{
return
method
.
toGenericString
();
}
@Override
public
Executable
getExecutable
()
{
return
method
;
}
@Override
public
Callable
<
Integer
>
getCallable
()
{
return
null
;
}
@Override
public
boolean
isOsr
()
{
return
false
;
}
protected
int
countCpuInstructions
(
byte
[]
nativeCode
)
{
int
count
=
0
;
int
patternSize
=
Math
.
min
(
instrMask
.
length
,
instrPattern
.
length
);
boolean
found
;
Asserts
.
assertGreaterThan
(
patternSize
,
0
);
for
(
int
i
=
0
,
n
=
nativeCode
.
length
-
patternSize
;
i
<
n
;
i
++)
{
found
=
true
;
for
(
int
j
=
0
;
j
<
patternSize
;
j
++)
{
if
((
nativeCode
[
i
+
j
]
&
instrMask
[
j
])
!=
instrPattern
[
j
])
{
found
=
false
;
break
;
}
}
if
(
found
)
{
++
count
;
i
+=
patternSize
-
1
;
}
}
return
count
;
}
public
boolean
verifyPositive
(
byte
[]
nativeCode
)
{
final
int
cnt
=
countCpuInstructions
(
nativeCode
);
if
(
Platform
.
isX86
())
{
return
cnt
>=
(
isLongOperation
?
2
:
1
);
}
else
{
return
Platform
.
isX64
()
&&
cnt
>=
1
;
}
}
protected
String
getCpuFlag
()
{
return
"bmi1"
;
}
protected
String
getVMFlag
()
{
return
"UseBMI1Instructions"
;
}
}
}
test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build LZcntTestI
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestI
*/
import
java.lang.reflect.Method
;
public
class
LZcntTestI
extends
BmiIntrinsicBase
.
BmiTestCase
{
protected
LZcntTestI
(
Method
method
)
{
super
(
method
);
instrMask
=
new
byte
[]{(
byte
)
0xFF
,
(
byte
)
0xFF
,
(
byte
)
0xFF
};
instrPattern
=
new
byte
[]{(
byte
)
0xF3
,
(
byte
)
0x0F
,
(
byte
)
0xBD
};
}
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
);
BmiIntrinsicBase
.
verifyTestCase
(
LZcntTestI:
:
new
,
TestLzcntI
.
LzcntIExpr
.
class
.
getDeclaredMethods
());
}
@Override
protected
String
getVMFlag
()
{
return
"UseCountLeadingZerosInstruction"
;
}
@Override
protected
String
getCpuFlag
()
{
return
"lzcnt"
;
}
}
test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build LZcntTestL
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestL
*/
import
com.oracle.java.testlibrary.Platform
;
import
java.lang.reflect.Method
;
public
class
LZcntTestL
extends
LZcntTestI
{
protected
LZcntTestL
(
Method
method
)
{
super
(
method
);
isLongOperation
=
true
;
if
(
Platform
.
isX64
())
{
instrMask
=
new
byte
[]{(
byte
)
0xFF
,
(
byte
)
0x00
,
(
byte
)
0xFF
,
(
byte
)
0xFF
};
instrPattern
=
new
byte
[]{(
byte
)
0xF3
,
(
byte
)
0x00
,
(
byte
)
0x0F
,
(
byte
)
0xBD
};
}
}
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
);
BmiIntrinsicBase
.
verifyTestCase
(
LZcntTestL:
:
new
,
TestLzcntL
.
LzcntLExpr
.
class
.
getDeclaredMethods
());
}
}
test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build TZcntTestI
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction TZcntTestI
*/
import
java.lang.reflect.Method
;
public
class
TZcntTestI
extends
BmiIntrinsicBase
.
BmiTestCase
{
protected
TZcntTestI
(
Method
method
)
{
super
(
method
);
instrMask
=
new
byte
[]{(
byte
)
0xFF
,
(
byte
)
0xFF
,
(
byte
)
0xFF
};
instrPattern
=
new
byte
[]{(
byte
)
0xF3
,
(
byte
)
0x0F
,
(
byte
)
0xBC
};
}
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
);
BmiIntrinsicBase
.
verifyTestCase
(
TZcntTestI:
:
new
,
TestTzcntI
.
TzcntIExpr
.
class
.
getDeclaredMethods
());
}
@Override
protected
String
getVMFlag
()
{
return
"UseCountTrailingZerosInstruction"
;
}
}
test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
0 → 100644
浏览文件 @
c528227d
/*
* Copyright (c) 2014, 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
* 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 8031321
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
* @build TZcntTestL
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction TZcntTestL
*/
import
com.oracle.java.testlibrary.Platform
;
import
java.lang.reflect.Method
;
public
class
TZcntTestL
extends
TZcntTestI
{
protected
TZcntTestL
(
Method
method
)
{
super
(
method
);
isLongOperation
=
true
;
if
(
Platform
.
isX64
())
{
instrMask
=
new
byte
[]{(
byte
)
0xFF
,
(
byte
)
0x00
,
(
byte
)
0xFF
,
(
byte
)
0xFF
};
instrPattern
=
new
byte
[]{(
byte
)
0xF3
,
(
byte
)
0x00
,
(
byte
)
0x0F
,
(
byte
)
0xBC
};
}
isLongOperation
=
true
;
}
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
);
BmiIntrinsicBase
.
verifyTestCase
(
TZcntTestL:
:
new
,
TestTzcntL
.
TzcntLExpr
.
class
.
getDeclaredMethods
());
}
}
test/testlibrary/com/oracle/java/testlibrary/Utils.java
浏览文件 @
c528227d
...
...
@@ -294,4 +294,23 @@ public final class Utils {
return
output
;
}
private
static
final
char
[]
hexArray
=
new
char
[]{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
};
/**
* Returns hex view of byte array
*
* @param bytes byte array to process
* @return Space separated hexadecimal string representation of bytes
*/
public
static
String
toHexString
(
byte
[]
bytes
)
{
char
[]
hexView
=
new
char
[
bytes
.
length
*
3
];
int
i
=
0
;
for
(
byte
b
:
bytes
)
{
hexView
[
i
++]
=
hexArray
[(
b
>>
4
)
&
0x0F
];
hexView
[
i
++]
=
hexArray
[
b
&
0x0F
];
hexView
[
i
++]
=
' '
;
}
return
new
String
(
hexView
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录