8351876: RISC-V: enable and fix some float round tests

Reviewed-by: fyang
This commit is contained in:
Hamlin Li 2025-03-17 11:47:18 +00:00
parent d207ed3f7c
commit dbf47d6c6c
2 changed files with 13 additions and 5 deletions

View File

@ -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 class TestRoundVectFloat {
}
@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]);

View File

@ -53,7 +53,8 @@ public class TestRoundVectRiscv64 {
}
@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 class TestRoundVectRiscv64 {
}
@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]);