Skip to content

Commit dbf47d6

Browse files
author
Hamlin Li
committed
8351876: RISC-V: enable and fix some float round tests
Reviewed-by: fyang
1 parent d207ed3 commit dbf47d6

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

test/hotspot/jtreg/compiler/vectorization/TestRoundVectFloat.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
* @bug 8279508
2727
* @summary Auto-vectorize Math.round API
2828
* @requires vm.compiler2.enabled
29-
* @requires vm.cpu.features ~= ".*avx.*"
30-
* @requires os.simpleArch == "x64"
29+
* @requires (os.simpleArch == "x64" & vm.cpu.features ~= ".*avx.*") |
30+
* (os.simpleArch == "riscv64" & vm.cpu.features ~= ".*rvv.*")
3131
* @library /test/lib /
3232
* @run driver compiler.vectorization.TestRoundVectFloat
3333
*/
@@ -49,7 +49,13 @@ public static void main(String args[]) {
4949
}
5050

5151
@Test
52-
@IR(applyIf = {"UseAVX", " > 1"}, counts = {IRNode.ROUND_VF , " > 0 "})
52+
@IR(applyIfPlatform = {"x64", "true"},
53+
applyIf = {"UseAVX", " > 1"},
54+
counts = {IRNode.ROUND_VF , " > 0 "})
55+
@IR(applyIfPlatform = {"riscv64", "true"},
56+
applyIfCPUFeature = {"rvv", "true"},
57+
applyIf = {"MaxVectorSize", ">= 32"},
58+
counts = {IRNode.ROUND_VF , " > 0 "})
5359
public void test_round_float(int[] iout, float[] finp) {
5460
for (int i = 0; i < finp.length; i+=1) {
5561
iout[i] = Math.round(finp[i]);

test/hotspot/jtreg/compiler/vectorization/TestRoundVectRiscv64.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public static void main(String args[]) {
5353
}
5454

5555
@Test
56-
@IR(counts = {IRNode.ROUND_VD, "> 0"})
56+
@IR(counts = {IRNode.ROUND_VD, "> 0"},
57+
applyIf = {"MaxVectorSize", ">= 64"})
5758
public void test_round_double(long[] lout, double[] dinp) {
5859
for (int i = 0; i < lout.length; i+=1) {
5960
lout[i] = Math.round(dinp[i]);
@@ -73,7 +74,8 @@ public void kernel_test_round_double() {
7374
}
7475

7576
@Test
76-
@IR(counts = {IRNode.ROUND_VF, "> 0"})
77+
@IR(counts = {IRNode.ROUND_VF, "> 0"},
78+
applyIf = {"MaxVectorSize", ">= 32"})
7779
public void test_round_float(int[] iout, float[] finp) {
7880
for (int i = 0; i < finp.length; i+=1) {
7981
iout[i] = Math.round(finp[i]);

0 commit comments

Comments
 (0)