public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][committed]middle-end: Fix signbit tests when ran on ISA with support for masks.
@ 2021-11-10 11:54 Tamar Christina
  2021-11-10 18:37 ` Sandra Loosemore
  0 siblings, 1 reply; 5+ messages in thread
From: Tamar Christina @ 2021-11-10 11:54 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd, rguenther

[-- Attachment #1: Type: text/plain, Size: 2168 bytes --]

Hi All,

These test don't work on vector ISAs where the truth
type don't match the vector mode of the operation.

However I still want the tests to run on these
architectures but just turn off the ISA modes that
enable masks.

This thus turns off SVE is it's on and turns off
AVX512 if it's on.

Regtested on aarch64-none-linux-gnu with SVE on,
and x86_64-pc-linux-gnu with AVX512 on and no
issues.

Committed under the obvious rule.

Thanks,
Tamar

gcc/testsuite/ChangeLog:

	* gcc.dg/signbit-2.c: Turn of masks.
	* gcc.dg/signbit-5.c: Likewise.

--- inline copy of patch -- 
diff --git a/gcc/testsuite/gcc.dg/signbit-2.c b/gcc/testsuite/gcc.dg/signbit-2.c
index fc0157cbc5c7996b481f2998bc30176c96a669bb..d8501e9b7a2d82b511ad0b3a44c0121d635972c0 100644
--- a/gcc/testsuite/gcc.dg/signbit-2.c
+++ b/gcc/testsuite/gcc.dg/signbit-2.c
@@ -1,6 +1,10 @@
 /* { dg-do assemble } */
 /* { dg-options "-O3 --save-temps -fdump-tree-optimized" } */
 
+/* This test does not work when the truth type does not match vector type.  */
+/* { dg-additional-options "-mno-avx512f" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-additional-options "-march=armv8-a" { target aarch64_sve } } */
+
 #include <stdint.h>
 
 void fun1(int32_t *x, int n)
@@ -15,5 +19,5 @@ void fun2(int32_t *x, int n)
       x[i] = (-x[i]) >> 30;
 }
 
-/* { dg-final { scan-tree-dump-times {\s+>\s+\{ 0, 0, 0, 0 \}} 1 optimized } } */
+/* { dg-final { scan-tree-dump {\s+>\s+\{ 0, 0, 0(, 0)+ \}} optimized } } */
 /* { dg-final { scan-tree-dump-not {\s+>>\s+31} optimized } } */
diff --git a/gcc/testsuite/gcc.dg/signbit-5.c b/gcc/testsuite/gcc.dg/signbit-5.c
index 22a92704773e3282759524b74d35196a477d43dd..2b119cdfda7d2888f914633c809b0aa7da5244b7 100644
--- a/gcc/testsuite/gcc.dg/signbit-5.c
+++ b/gcc/testsuite/gcc.dg/signbit-5.c
@@ -1,6 +1,11 @@
 /* { dg-do run } */
 /* { dg-options "-O3" } */
 
+/* This test does not work when the truth type does not match vector type.  */
+/* { dg-additional-options "-mno-avx512f" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-additional-options "-march=armv8-a" { target aarch64_sve } } */
+
 #include <stdint.h>
 #include <limits.h>
 #include <stdio.h>


-- 

[-- Attachment #2: rb15054.patch --]
[-- Type: text/x-diff, Size: 1588 bytes --]

diff --git a/gcc/testsuite/gcc.dg/signbit-2.c b/gcc/testsuite/gcc.dg/signbit-2.c
index fc0157cbc5c7996b481f2998bc30176c96a669bb..d8501e9b7a2d82b511ad0b3a44c0121d635972c0 100644
--- a/gcc/testsuite/gcc.dg/signbit-2.c
+++ b/gcc/testsuite/gcc.dg/signbit-2.c
@@ -1,6 +1,10 @@
 /* { dg-do assemble } */
 /* { dg-options "-O3 --save-temps -fdump-tree-optimized" } */
 
+/* This test does not work when the truth type does not match vector type.  */
+/* { dg-additional-options "-mno-avx512f" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-additional-options "-march=armv8-a" { target aarch64_sve } } */
+
 #include <stdint.h>
 
 void fun1(int32_t *x, int n)
@@ -15,5 +19,5 @@ void fun2(int32_t *x, int n)
       x[i] = (-x[i]) >> 30;
 }
 
-/* { dg-final { scan-tree-dump-times {\s+>\s+\{ 0, 0, 0, 0 \}} 1 optimized } } */
+/* { dg-final { scan-tree-dump {\s+>\s+\{ 0, 0, 0(, 0)+ \}} optimized } } */
 /* { dg-final { scan-tree-dump-not {\s+>>\s+31} optimized } } */
diff --git a/gcc/testsuite/gcc.dg/signbit-5.c b/gcc/testsuite/gcc.dg/signbit-5.c
index 22a92704773e3282759524b74d35196a477d43dd..2b119cdfda7d2888f914633c809b0aa7da5244b7 100644
--- a/gcc/testsuite/gcc.dg/signbit-5.c
+++ b/gcc/testsuite/gcc.dg/signbit-5.c
@@ -1,6 +1,11 @@
 /* { dg-do run } */
 /* { dg-options "-O3" } */
 
+/* This test does not work when the truth type does not match vector type.  */
+/* { dg-additional-options "-mno-avx512f" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-additional-options "-march=armv8-a" { target aarch64_sve } } */
+
+
 #include <stdint.h>
 #include <limits.h>
 #include <stdio.h>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-11 13:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 11:54 [PATCH][committed]middle-end: Fix signbit tests when ran on ISA with support for masks Tamar Christina
2021-11-10 18:37 ` Sandra Loosemore
2021-11-10 18:53   ` Tamar Christina
2021-11-10 20:03     ` Sandra Loosemore
2021-11-11 13:24       ` Tamar Christina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).