diff --git a/test/hotspot/jtreg/compiler/vectorization/TestRoundVectFloat.java b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectFloat.java index 7cf4ae17cb4f0..65f12be111ae9 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestRoundVectFloat.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectFloat.java @@ -26,8 +26,8 @@ * @bug 8279508 * @summary Auto-vectorize Math.round API * @requires vm.compiler2.enabled - * @requires vm.cpu.features ~= ".*avx.*" - * @requires os.simpleArch == "x64" + * @requires (os.simpleArch == "x64" & vm.cpu.features ~= ".*avx.*") | + * (os.simpleArch == "riscv64" & vm.cpu.features ~= ".*rvv.*") * @library /test/lib / * @run driver compiler.vectorization.TestRoundVectFloat */ @@ -49,7 +49,13 @@ public static void main(String args[]) { } @Test - @IR(applyIf = {"UseAVX", " > 1"}, counts = {IRNode.ROUND_VF , " > 0 "}) + @IR(applyIfPlatform = {"x64", "true"}, + applyIf = {"UseAVX", " > 1"}, + counts = {IRNode.ROUND_VF , " > 0 "}) + @IR(applyIfPlatform = {"riscv64", "true"}, + applyIfCPUFeature = {"rvv", "true"}, + applyIf = {"MaxVectorSize", ">= 32"}, + counts = {IRNode.ROUND_VF , " > 0 "}) public void test_round_float(int[] iout, float[] finp) { for (int i = 0; i < finp.length; i+=1) { iout[i] = Math.round(finp[i]); diff --git a/test/hotspot/jtreg/compiler/vectorization/TestRoundVectRiscv64.java b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectRiscv64.java index 530befbe2bcb5..252f1f1c166a7 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestRoundVectRiscv64.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectRiscv64.java @@ -53,7 +53,8 @@ public static void main(String args[]) { } @Test - @IR(counts = {IRNode.ROUND_VD, "> 0"}) + @IR(counts = {IRNode.ROUND_VD, "> 0"}, + applyIf = {"MaxVectorSize", ">= 64"}) public void test_round_double(long[] lout, double[] dinp) { for (int i = 0; i < lout.length; i+=1) { lout[i] = Math.round(dinp[i]); @@ -73,7 +74,8 @@ public void kernel_test_round_double() { } @Test - @IR(counts = {IRNode.ROUND_VF, "> 0"}) + @IR(counts = {IRNode.ROUND_VF, "> 0"}, + applyIf = {"MaxVectorSize", ">= 32"}) public void test_round_float(int[] iout, float[] finp) { for (int i = 0; i < finp.length; i+=1) { iout[i] = Math.round(finp[i]);