aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKewen Lin <linkw@linux.ibm.com>2022-09-30 07:16:36 -0500
committerKewen Lin <linkw@linux.ibm.com>2022-09-30 07:16:36 -0500
commitc28957176dc0adff6e4b8fcbe6b91f5b82900563 (patch)
treea67a5cb1b9221ab53cfd86c91fb1d8db999790a9
parentc09663eabfb84ac56ddd8d44abcab3f4902c83bd (diff)
downloadgcc-c28957176dc0adff6e4b8fcbe6b91f5b82900563.zip
gcc-c28957176dc0adff6e4b8fcbe6b91f5b82900563.tar.gz
gcc-c28957176dc0adff6e4b8fcbe6b91f5b82900563.tar.bz2
rs6000/test: Adjust pr104992.c with vect_int_mod [PR106516]
As PR106516 shows, we can get unexpected gimple outputs for function thud on some target which supports modulus operation for vector int. This patch introduces one effective target vect_int_mod for it, then adjusts the test case with it. PR testsuite/106516 gcc/testsuite/ChangeLog: * gcc.dg/pr104992.c: Adjust with vect_int_mod. * lib/target-supports.exp (check_effective_target_vect_int_mod): New effective target.
-rw-r--r--gcc/testsuite/gcc.dg/pr104992.c3
-rw-r--r--gcc/testsuite/lib/target-supports.exp8
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/pr104992.c b/gcc/testsuite/gcc.dg/pr104992.c
index 217c89a..82f8c75 100644
--- a/gcc/testsuite/gcc.dg/pr104992.c
+++ b/gcc/testsuite/gcc.dg/pr104992.c
@@ -54,4 +54,5 @@ __attribute__((noipa)) unsigned waldo (unsigned x, unsigned y, unsigned z) {
return x / y * z == x;
}
-/* { dg-final {scan-tree-dump-times " % " 9 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " % " 9 "optimized" { target { ! vect_int_mod } } } } */
+/* { dg-final { scan-tree-dump-times " % " 6 "optimized" { target vect_int_mod } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 2a2dd05..0a959c6 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8263,6 +8263,14 @@ proc check_effective_target_vect_long_mult { } {
return $answer
}
+# Return 1 if the target supports vector int modulus, 0 otherwise.
+
+proc check_effective_target_vect_int_mod { } {
+ return [check_cached_effective_target_indexed vect_int_mod {
+ expr { [istarget powerpc*-*-*]
+ && [check_effective_target_has_arch_pwr10] }}]
+}
+
# Return 1 if the target supports vector even/odd elements extraction, 0 otherwise.
proc check_effective_target_vect_extract_even_odd { } {