Hi,

This patch modifies gcc.dg/vect/slp-reduc-15.c to add aarch64 support with 
-march=armv8.2-a+sve and restricts the test to x86_64 and aarch64 only.

Tested on aarch64 and x86_64.

OK for trunk?

Thanks,
Lili



The test uses __GIMPLE with .COND_ADD internal function, which requires
architecture-specific options to enable masked/conditional vector operations.
The test was previously x86_64-only, causing failures on aarch64.

This patch adds aarch64 support with -march=armv8.2-a+sve for SVE, and
restricts the test to only run on x86_64 and aarch64 platforms where we
provide the appropriate -march options. On other platforms (RISC-V, PowerPC,
etc.), the test is skipped.

See also:
https://linaro.atlassian.net/browse/GNU-1901

gcc/testsuite/ChangeLog:

        * gcc.dg/vect/slp-reduc-15.c: Add aarch64 SVE support and
        restrict test to x86_64 and aarch64 targets only.
---
 gcc/testsuite/gcc.dg/vect/slp-reduc-15.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/vect/slp-reduc-15.c 
b/gcc/testsuite/gcc.dg/vect/slp-reduc-15.c
index 4745f85511b..d22114d6960 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-reduc-15.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-reduc-15.c
@@ -1,6 +1,7 @@
-/* { dg-do compile } */
-/* { dg-require-effective-target vect_float } */
-/* { dg-additional-options "-fgimple -march=x86-64-v3" { target x86_64-*-* } } 
*/
+/* { dg-do compile { target { x86_64-*-* || aarch64-*-* } } } */
+/* { dg-additional-options "-fgimple" } */
+/* { dg-additional-options "-march=x86-64-v3" { target x86_64-*-* } } */
+/* { dg-additional-options "-march=armv8.2-a+sve" { target aarch64-*-* } } */
 
 /* Test that SLP reduction vectorization handles commutative operand swap
    for .COND_ADD in multi-lane SLP where the reduction operand appears
@@ -76,6 +77,6 @@ foo (float * restrict p0, float * restrict p1,
 
 /* With the IFN commutative swap fix, these 4 reductions should be
    vectorized using SLP despite different reduc_idx values (1 vs 2).  */
-/* { dg-final { scan-tree-dump "swapped operands to match def types in" "vect" 
{ target x86_64-*-* } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { 
target x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "swapped operands to match def types in" "vect" 
} } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" } 
} */
 
-- 
2.34.1

Reply via email to