]> gcc.gnu.org Git - gcc.git/commitdiff
rs6000/test: Adjust pr104992.c with vect_int_mod [PR106516]
authorKewen Lin <linkw@linux.ibm.com>
Fri, 30 Sep 2022 12:16:36 +0000 (07:16 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Fri, 30 Sep 2022 12:16:36 +0000 (07:16 -0500)
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.

gcc/testsuite/gcc.dg/pr104992.c
gcc/testsuite/lib/target-supports.exp

index 217c89a458c191d68cef89931d5b64a5c9e140d2..82f8c75559ca0338958c6a3934e42a504f047264 100644 (file)
@@ -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 } } } */
index 2a2dd05db1eab519d519e8b104081eaea4d51e34..0a959c63c4aa686894460f708713454f20df0601 100644 (file)
@@ -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 { } {
This page took 0.08119 seconds and 5 git commands to generate.