This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] gcc.dg/vect tests: simplify dg-final xfails


This patch takes advantage of new functionality to use effective-target
keywords in xfail lists for dg-final directives in some of the
autovectorization tests.  The new effective-target keywords indicate
lack of certain vector support: vect_no_max, vect_no_bitwise, and
vect_no_align.

This patch doesn't clean things up completely, but perhaps the same
mechanism can be used to simplify the xfail lists in some of these
tests:

  vect-48a.c, vect-56a.c, and vect-77a use "xfail sparc*-*-* alpha*-*-*";
  vect-77a also fails for powerpc64-linux with -m64

  vect-77.c and vect-78.c use "xfail i?86-*-* x86_64-*-* sparc*-*-*
  alpha*-*-*"; they also fail for powerpc64-linux with -m64

It's possible, although ugly, to define effective targets like
"vect_no_align_or_ppc64" to cover all cases for a test, or to do one
specific to a test "vect_78a_xfail".  The check_* functions can appear
in the local vect.exp file if they're very specific like that.

Dorit and others familiar with these tests, does this look
reasonable?  Feel free to suggest better names, and please verify that
the check_* functions are correct.

2004-12-03  Janis Johnson  <janis187@us.ibm.com>

	* lib/target-supports.exp (check_effective_target_vect_no_max): New.
	(check_effective_target_vect_no_bitwise): New.
	(check_effective_target_vect_no_align): New.
	* gcc.dg/vect/vect-13.c: xfail for effective-target keyword.
	* gcc.dg/vect/vect-17.c: Ditto.
	* gcc.dg/vect/vect-18.c: Ditto.
	* gcc.dg/vect/vect-19.c: Ditto.
	* gcc.dg/vect/vect-20.c: Ditto.
	* gcc.dg/vect/vect-27.c: Ditto.
	* gcc.dg/vect/vect-29.c: Ditto.
	* gcc.dg/vect/vect-44.c: Ditto.
	* gcc.dg/vect/vect-46.c: Ditto.
	* gcc.dg/vect/vect-48.c: Ditto.
	* gcc.dg/vect/vect-50.c: Ditto.
	* gcc.dg/vect/vect-52.c: Ditto.
	* gcc.dg/vect/vect-54.c: Ditto.
	* gcc.dg/vect/vect-56.c: Ditto.
	* gcc.dg/vect/vect-58.c: Ditto.
	* gcc.dg/vect/vect-60.c: Ditto.
	* gcc.dg/vect/vect-72.c: Ditto.
	* gcc.dg/vect/vect-80.c: Ditto.

--- lib/target-supports.exp.orig	2004-12-02 12:25:14.000000000 -0800
+++ lib/target-supports.exp	2004-12-02 11:59:08.000000000 -0800
@@ -518,6 +518,70 @@ proc check_effective_target_vect_double 
     return $et_vect_double_saved
 }
 
+# Return 1 if the target plus current options does not support a vector
+# max instruction, 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_vect_no_max { } {
+    global et_vect_no_max_saved
+
+    if [info exists et_vect_no_max_saved] {
+	verbose "check_effective_target_vect_no_max: using cached result" 2
+    } else {
+	set et_vect_no_max_saved 0
+	if { [istarget i?86-*-*]
+	     || [istarget x86_64-*-*-*] } {
+	    set et_vect_no_max_saved 1
+	}
+    }
+    verbose "check_effective_target_vect_no_max: returning $et_vect_no_max_saved" 2
+    return $et_vect_no_max_saved
+}
+
+# Return 1 if the target plus current options does not support vector
+# bitwise instructions, 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_vect_no_bitwise { } {
+    global et_vect_no_bitwise_saved
+
+    if [info exists et_vect_no_bitwise_saved] {
+	verbose "check_effective_target_vect_no_bitwise: using cached result" 2
+    } else {
+	set et_vect_no_bitwise_saved 0
+	if { [istarget i?86-*-*]
+	     || [istarget x86_64-*-*-*] } {
+	    set et_vect_no_bitwise_saved 1
+	}
+    }
+    verbose "check_effective_target_vect_no_bitwise: returning $et_vect_no_bitwise_saved" 2
+    return $et_vect_no_bitwise_saved
+}
+
+# Return 1 if the target plus current options does not support a vector
+# alignment mechanism, 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_vect_no_align { } {
+    global et_vect_no_align_saved
+
+    if [info exists et_vect_no_align_saved] {
+	verbose "check_effective_target_vect_no_align: using cached result" 2
+    } else {
+	set et_vect_no_align_saved 0
+	if { [istarget i?86-*-*]
+	     || [istarget x86_64-*-*]
+	     || [istarget mipsisa64-*-*] } {
+	    set et_vect_no_align_saved 1
+	}
+    }
+    verbose "check_effective_target_vect_no_align: returning $et_vect_no_align_saved" 2
+    return $et_vect_no_align_saved
+}
+
 # Return 1 if the target matches the effective target 'arg', 0 otherwise.
 # This can be used with any check_* proc that takes no argument and
 # returns only 1 or 0.  It could be used with check_* procs that take
Index: gcc.dg/vect/vect-13.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-13.c,v
retrieving revision 1.7
diff -u -p -r1.7 vect-13.c
--- gcc.dg/vect/vect-13.c	23 Nov 2004 22:03:30 -0000	1.7
+++ gcc.dg/vect/vect-13.c	29 Nov 2004 18:49:37 -0000
@@ -36,6 +36,4 @@ int main (void)
   return main1 ();
 }
 
-/* These fail to vectorize on targets that don't have or model a vector
-   max operation.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* sparc*-*-* alpha*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_max } } } */
Index: gcc.dg/vect/vect-17.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-17.c,v
retrieving revision 1.4
diff -u -p -r1.4 vect-17.c
--- gcc.dg/vect/vect-17.c	23 Nov 2004 22:03:30 -0000	1.4
+++ gcc.dg/vect/vect-17.c	29 Nov 2004 18:49:53 -0000
@@ -124,6 +124,4 @@ int main (void)
   return main1 ();
 }
 
-/* These fail to vectorize on targets that don't have or model vector
-   bitwise operations.  */
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-* alpha*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */
Index: gcc.dg/vect/vect-18.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-18.c,v
retrieving revision 1.4
diff -u -p -r1.4 vect-18.c
--- gcc.dg/vect/vect-18.c	23 Nov 2004 22:03:30 -0000	1.4
+++ gcc.dg/vect/vect-18.c	29 Nov 2004 18:50:05 -0000
@@ -123,6 +123,4 @@ int main (void)
   return main1 ();
 }
 
-/* These fail to vectorize on targets that don't have or model vector
-   bitwise operations.  */
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-* alpha*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */
Index: gcc.dg/vect/vect-19.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-19.c,v
retrieving revision 1.4
diff -u -p -r1.4 vect-19.c
--- gcc.dg/vect/vect-19.c	23 Nov 2004 22:03:30 -0000	1.4
+++ gcc.dg/vect/vect-19.c	29 Nov 2004 18:50:18 -0000
@@ -123,6 +123,4 @@ int main (void)
   return main1 ();
 }
 
-/* These fail to vectorize on targets that don't have or model vector
-   bitwise operations.  */
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-* alpha*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */
Index: gcc.dg/vect/vect-20.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-20.c,v
retrieving revision 1.5
diff -u -p -r1.5 vect-20.c
--- gcc.dg/vect/vect-20.c	23 Nov 2004 22:03:30 -0000	1.5
+++ gcc.dg/vect/vect-20.c	29 Nov 2004 18:50:45 -0000
@@ -95,6 +95,4 @@ int main (void)
   return main1 ();
 }
 
-/* These fail to vectorize on targets that don't have or model vector
-   bitwise operations.  */
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-* alpha*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */
Index: gcc.dg/vect/vect-27.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-27.c,v
retrieving revision 1.4
diff -u -p -r1.4 vect-27.c
--- gcc.dg/vect/vect-27.c	20 Nov 2004 17:34:28 -0000	1.4
+++ gcc.dg/vect/vect-27.c	29 Nov 2004 18:50:52 -0000
@@ -40,7 +40,4 @@ int main (void)
   return main1 ();
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* sparc*-*-* } } } */
-
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
Index: gcc.dg/vect/vect-29.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-29.c,v
retrieving revision 1.4
diff -u -p -r1.4 vect-29.c
--- gcc.dg/vect/vect-29.c	20 Nov 2004 17:34:28 -0000	1.4
+++ gcc.dg/vect/vect-29.c	29 Nov 2004 18:50:58 -0000
@@ -43,7 +43,4 @@ int main (void)
   return 0;
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* sparc*-*-* } } } */
-
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
Index: gcc.dg/vect/vect-44.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-44.c,v
retrieving revision 1.6
diff -u -p -r1.6 vect-44.c
--- gcc.dg/vect/vect-44.c	17 Nov 2004 23:47:20 -0000	1.6
+++ gcc.dg/vect/vect-44.c	18 Nov 2004 21:50:11 -0000
@@ -54,6 +54,4 @@ int main (void)
   return 0;
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* mipsisa64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
Index: gcc.dg/vect/vect-46.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-46.c,v
retrieving revision 1.5
diff -u -p -r1.5 vect-46.c
--- gcc.dg/vect/vect-46.c	17 Nov 2004 23:47:20 -0000	1.5
+++ gcc.dg/vect/vect-46.c	29 Nov 2004 22:25:43 -0000
@@ -50,6 +50,4 @@ int main (void)
   return 0;
 }
 
-/* This fails to vectorize for 64-bit powerpc but there's no way to
-   specify that in an xfail list.  */
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
Index: gcc.dg/vect/vect-48.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-48.c,v
retrieving revision 1.4
diff -u -p -r1.4 vect-48.c
--- gcc.dg/vect/vect-48.c	17 Nov 2004 23:47:20 -0000	1.4
+++ gcc.dg/vect/vect-48.c	18 Nov 2004 21:32:44 -0000
@@ -52,6 +52,4 @@ int main (void)
   return 0;
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* mipsisa64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
Index: gcc.dg/vect/vect-50.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-50.c,v
retrieving revision 1.6
diff -u -p -r1.6 vect-50.c
--- gcc.dg/vect/vect-50.c	17 Nov 2004 23:47:20 -0000	1.6
+++ gcc.dg/vect/vect-50.c	29 Nov 2004 22:25:53 -0000
@@ -49,7 +49,4 @@ int main (void)
   return 0;
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  They also fail to vectorize for 64-bit powerpc but there's no
-   way to specify that in an xfail list.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* mipsisa64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
Index: gcc.dg/vect/vect-52.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-52.c,v
retrieving revision 1.6
diff -u -p -r1.6 vect-52.c
--- gcc.dg/vect/vect-52.c	17 Nov 2004 23:47:20 -0000	1.6
+++ gcc.dg/vect/vect-52.c	29 Nov 2004 22:26:07 -0000
@@ -51,7 +51,4 @@ int main (void)
   return 0;
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  They also fail to vectorize for 64-bit powerpc but there's no
-   way to specify that in an xfail list.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* mipsisa64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
Index: gcc.dg/vect/vect-54.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-54.c,v
retrieving revision 1.6
diff -u -p -r1.6 vect-54.c
--- gcc.dg/vect/vect-54.c	17 Nov 2004 23:47:20 -0000	1.6
+++ gcc.dg/vect/vect-54.c	18 Nov 2004 21:33:37 -0000
@@ -50,6 +50,4 @@ int main (void)
   return 0;
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* mipsisa64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
Index: gcc.dg/vect/vect-56.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-56.c,v
retrieving revision 1.4
diff -u -p -r1.4 vect-56.c
--- gcc.dg/vect/vect-56.c	17 Nov 2004 23:47:20 -0000	1.4
+++ gcc.dg/vect/vect-56.c	18 Nov 2004 21:33:52 -0000
@@ -50,6 +50,4 @@ int main (void)
   return 0;
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* mipsisa64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
Index: gcc.dg/vect/vect-58.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-58.c,v
retrieving revision 1.6
diff -u -p -r1.6 vect-58.c
--- gcc.dg/vect/vect-58.c	17 Nov 2004 23:47:20 -0000	1.6
+++ gcc.dg/vect/vect-58.c	29 Nov 2004 22:26:10 -0000
@@ -51,7 +51,4 @@ int main (void)
   return 0;
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  They also fail to vectorize for 64-bit powerpc but there's no
-   way to specify that in an xfail list.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* mipsisa64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
Index: gcc.dg/vect/vect-60.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-60.c,v
retrieving revision 1.6
diff -u -p -r1.6 vect-60.c
--- gcc.dg/vect/vect-60.c	17 Nov 2004 23:47:21 -0000	1.6
+++ gcc.dg/vect/vect-60.c	29 Nov 2004 22:25:55 -0000
@@ -51,6 +51,4 @@ int main (void)
   return 0;
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* mipsisa64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
Index: gcc.dg/vect/vect-72.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-72.c,v
retrieving revision 1.4
diff -u -p -r1.4 vect-72.c
--- gcc.dg/vect/vect-72.c	20 Nov 2004 17:34:28 -0000	1.4
+++ gcc.dg/vect/vect-72.c	29 Nov 2004 18:51:04 -0000
@@ -40,7 +40,4 @@ int main (void)
   return main1 ();
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* sparc*-*-* } } } */
-
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
Index: gcc.dg/vect/vect-80.c
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect-80.c,v
retrieving revision 1.6
diff -u -p -r1.6 vect-80.c
--- gcc.dg/vect/vect-80.c	17 Nov 2004 23:47:21 -0000	1.6
+++ gcc.dg/vect/vect-80.c	18 Nov 2004 21:35:06 -0000
@@ -42,6 +42,4 @@ int main (void)
   return 0;	
 }
 
-/* These are not yet vectorized on targets that do not model alignment-handling
-   mechanisms.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* mipsisa64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]