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]

Re: [RFC] patch: cleanup gcc.dg/vect/ (take 3)





> I had hoped to
> be able to xfail classes of targets, such as targets that don't handle
> vector alignment, but don't yet have a way to do that so the xfail
> lists still name specific targets.

Thanks for trying.

A question: how would you write a testcase that when compiled on powerpc*
the dg-final check xfails for powerpc64* or if -m64 is used? (I want to
xfail testcase pr18425.c for 64bit, and temporarily also xfail testcases
vect-[77,77a,78].c for 64bit - see PR18403).

thanks,
dorit




                                                                                                                                
                      Janis Johnson                                                                                             
                      <janis187@us.ibm.        To:       gcc-patches@gcc.gnu.org, Dorit Naishlos/Haifa/IBM@IBMIL,               
                      com>                      aldyh@redhat.com, ja2morri@csclub.uwaterloo.ca, dpatel@apple.com                
                                               cc:                                                                              
                      16/11/2004 03:05         Subject:  [RFC] patch: cleanup gcc.dg/vect/ (take 3)                             
                                                                                                                                




Here's another attempt at cleaning up the autovectorization tests in
gcc.dg/vect, without any TCL tricks this time.  It defines a few
classes of vector support in target_supports.exp, for targets that
support vector int, vector float, and vector double.  I had hoped to
be able to xfail classes of targets, such as targets that don't handle
vector alignment, but don't yet have a way to do that so the xfail
lists still name specific targets.

I've tested this on powerpc64-unknown-linux-gnu with -m32 and -m64, on
i686-pc-linux-gnu, and mipsisa64-elf.  I'd appreciate it if others can
try it on sparc, and on othre targets I might have missed.  There's lots
of room here for me to have made mistakes.

2004-11-15  Janis Johnson  <janis187@us.ibm.com>
            Aldy Hernandez  <aldyh@redhat.com>

             * lib/target-supports.exp (check_effective_target_vect_int):
New
             (check_effective_target_vect_float): New
             (check_effective_target_vect_double): New.
             (is-effective-target): Support new effective targets keywords.
             * gcc.dg/vect/vect.exp: Set target-dependent vector flags and
             default action for dg-do.
             * gcc.dg/vect/pr16105.c: Use new support.
             * gcc.dg/vect/pr18400.c: Ditto.
             * gcc.dg/vect/pr18425.c: Ditto.
             * gcc.dg/vect/vect-1.c: Ditto.
             * gcc.dg/vect/vect-10.c: Ditto.
             * gcc.dg/vect/vect-11.c: Ditto.
             * gcc.dg/vect/vect-12.c: Ditto.
             * gcc.dg/vect/vect-13.c: Ditto.
             * gcc.dg/vect/vect-14.c: Ditto.
             * gcc.dg/vect/vect-15.c: Ditto.
             * gcc.dg/vect/vect-16.c: Ditto.
             * 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-2.c: Ditto.
             * gcc.dg/vect/vect-20.c: Ditto.
             * gcc.dg/vect/vect-21.c: Ditto.
             * gcc.dg/vect/vect-22.c: Ditto.
             * gcc.dg/vect/vect-23.c: Ditto.
             * gcc.dg/vect/vect-24.c: Ditto.
             * gcc.dg/vect/vect-25.c: Ditto.
             * gcc.dg/vect/vect-26.c: Ditto.
             * gcc.dg/vect/vect-27.c: Ditto.
             * gcc.dg/vect/vect-27a.c: Ditto.
             * gcc.dg/vect/vect-28.c: Ditto.
             * gcc.dg/vect/vect-29.c: Ditto.
             * gcc.dg/vect/vect-29a.c: Ditto.
             * gcc.dg/vect/vect-3.c: Ditto.
             * gcc.dg/vect/vect-30.c: Ditto.
             * gcc.dg/vect/vect-31.c: Ditto.
             * gcc.dg/vect/vect-32.c: Ditto.
             * gcc.dg/vect/vect-33.c: Ditto.
             * gcc.dg/vect/vect-34.c: Ditto.
             * gcc.dg/vect/vect-35.c: Ditto.
             * gcc.dg/vect/vect-36.c: Ditto.
             * gcc.dg/vect/vect-37.c: Ditto.
             * gcc.dg/vect/vect-38.c: Ditto.
             * gcc.dg/vect/vect-4.c: Ditto.
             * gcc.dg/vect/vect-40.c: Ditto.
             * gcc.dg/vect/vect-41.c: Ditto.
             * gcc.dg/vect/vect-42.c: Ditto.
             * gcc.dg/vect/vect-43.c: Ditto.
             * gcc.dg/vect/vect-44.c: Ditto.
             * gcc.dg/vect/vect-45.c: Ditto.
             * gcc.dg/vect/vect-46.c: Ditto.
             * gcc.dg/vect/vect-47.c: Ditto.
             * gcc.dg/vect/vect-48.c: Ditto.
             * gcc.dg/vect/vect-48a.c: Ditto.
             * gcc.dg/vect/vect-49.c: Ditto.
             * gcc.dg/vect/vect-5.c: Ditto.
             * gcc.dg/vect/vect-50.c: Ditto.
             * gcc.dg/vect/vect-51.c: Ditto.
             * gcc.dg/vect/vect-52.c: Ditto.
             * gcc.dg/vect/vect-53.c: Ditto.
             * gcc.dg/vect/vect-54.c: Ditto.
             * gcc.dg/vect/vect-55.c: Ditto.
             * gcc.dg/vect/vect-56.c: Ditto.
             * gcc.dg/vect/vect-56a.c: Ditto.
             * gcc.dg/vect/vect-57.c: Ditto.
             * gcc.dg/vect/vect-58.c: Ditto.
             * gcc.dg/vect/vect-59.c: Ditto.
             * gcc.dg/vect/vect-6.c: Ditto.
             * gcc.dg/vect/vect-60.c: Ditto.
             * gcc.dg/vect/vect-61.c: Ditto.
             * gcc.dg/vect/vect-62.c: Ditto.
             * gcc.dg/vect/vect-63.c: Ditto.
             * gcc.dg/vect/vect-64.c: Ditto.
             * gcc.dg/vect/vect-65.c: Ditto.
             * gcc.dg/vect/vect-66.c: Ditto.
             * gcc.dg/vect/vect-67.c: Ditto.
             * gcc.dg/vect/vect-68.c: Ditto.
             * gcc.dg/vect/vect-69.c: Ditto.
             * gcc.dg/vect/vect-7.c: Ditto.
             * gcc.dg/vect/vect-72.c: Ditto.
             * gcc.dg/vect/vect-72a.c: Ditto.
             * gcc.dg/vect/vect-73.c: Ditto.
             * gcc.dg/vect/vect-74.c: Ditto.
             * gcc.dg/vect/vect-75.c: Ditto.
             * gcc.dg/vect/vect-76.c: Ditto.
             * gcc.dg/vect/vect-77.c: Ditto.
             * gcc.dg/vect/vect-77a.c: Ditto.
             * gcc.dg/vect/vect-78.c: Ditto.
             * gcc.dg/vect/vect-79.c: Ditto.
             * gcc.dg/vect/vect-8.c: Ditto.
             * gcc.dg/vect/vect-80.c: Ditto.
             * gcc.dg/vect/vect-82.c: Ditto.
             * gcc.dg/vect/vect-82_64.c: Ditto.
             * gcc.dg/vect/vect-83.c: Ditto.
             * gcc.dg/vect/vect-83_64.c: Ditto.
             * gcc.dg/vect/vect-9.c: Ditto.
             * gcc.dg/vect/vect-all.c: Ditto.
             * gcc.dg/vect/vect-none.c: Ditto.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/lib/target-supports.exp,v
retrieving revision 1.26
diff -u -p -r1.26 target-supports.exp
--- gcc/testsuite/lib/target-supports.exp        12 Nov 2004 01:11:01 -0000
       1.26
+++ gcc/testsuite/lib/target-supports.exp        15 Nov 2004 23:41:32 -0000
@@ -392,6 +392,73 @@ proc check_effective_target_lp64 { } {
     return $answer
 }

+# Return 1 if the target supports hardware vectors of int, 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_vect_int { } {
+    global et_vect_int_saved
+
+    if [info exists et_vect_int_saved] {
+            verbose "check_effective_target_vect_int: using cached result"
2
+    } else {
+            set et_vect_int_saved 0
+            if { [istarget i?86-*-*]
+                  || [istarget powerpc*-*-*]
+                  || [istarget x86_64-*-*]
+                  || [istarget sparc*-*-*] } {
+               set et_vect_int_saved 1
+            }
+    }
+
+    verbose "check_effective_target_vect_int: returning
$et_vect_int_saved" 2
+    return $et_vect_int_saved
+}
+
+# Return 1 if the target supports hardware vectors of float, 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_vect_float { } {
+    global et_vect_float_saved
+
+    if [info exists et_vect_float_saved] {
+            verbose "check_effective_target_vect_float: using cached
result" 2
+    } else {
+            set et_vect_float_saved 0
+            if { [istarget i?86-*-*]
+                  || [istarget powerpc*-*-*]
+                  || [istarget mipsisa64*-*-*]
+                  || [istarget x86_64-*-*] } {
+               set et_vect_float_saved 1
+            }
+    }
+
+    verbose "check_effective_target_vect_float: returning
$et_vect_float_saved" 2
+    return $et_vect_float_saved
+}
+
+# Return 1 if the target supports hardware vectors of double, 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_vect_double { } {
+    global et_vect_double_saved
+
+    if [info exists et_vect_double_saved] {
+            verbose "check_effective_target_vect_double: using cached
result" 2
+    } else {
+            set et_vect_double_saved 0
+            if { [istarget i?86-*-*]
+                  || [istarget x86_64-*-*] } {
+               set et_vect_double_saved 1
+            }
+    }
+
+    verbose "check_effective_target_vect_double: returning
$et_vect_double_saved" 2
+    return $et_vect_double_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
@@ -405,6 +472,9 @@ proc is-effective-target { arg } {
             "vmx_hw" { set selected [check_vmx_hw_available] }
             "named_sections" { set selected
[check_named_sections_available] }
             "gc_sections" { set selected [check_gc_sections_available] }
+            "vect_int" { set selected [check_effective_target_vect_int] }
+            "vect_float" { set selected
[check_effective_target_vect_float] }
+            "vect_double" { set selected
[check_effective_target_vect_double] }
             default  { error "unknown effective target selector `$arg'" }
     }
     verbose "is-effective-target: $arg $selected" 2
Index: gcc/testsuite/gcc.dg/vect/vect.exp
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.dg/vect/vect.exp,v
retrieving revision 1.1
diff -u -p -r1.1 vect.exp
--- gcc/testsuite/gcc.dg/vect/vect.exp           17 Aug 2004 16:17:14 -0000
       1.1
+++ gcc/testsuite/gcc.dg/vect/vect.exp           15 Nov 2004 19:41:18 -0000
@@ -1,4 +1,4 @@
-#   Copyright (C) 1997 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2004 Free Software Foundation, Inc.

 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,17 +19,58 @@
 # Load support procs.
 load_lib gcc-dg.exp

-# If a testcase doesn't have special options, use these.
-global DEFAULT_CFLAGS
-if ![info exists DEFAULT_CFLAGS] then {
-    set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+# Set up flags used for tests that don't specify options.
+set DEFAULT_VECTCFLAGS ""
+
+# These flags are used for all targets.
+lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize"
"-fdump-tree-vect-stats"
+
+# If the target system supports vector instructions, the default action
+# for a test is 'run', otherwise it's 'compile'.  Save current default.
+# Executing vector instructions on a system without hardware vector
support
+# is also disabled by a call to check_vect, but disabling execution here
is
+# more efficient.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+
+# Skip these tests for targets that do not support generating vector
+# code.  Set additional target-dependent vector flags, which can be
+# overridden by using dg-options in individual tests.
+if [istarget "powerpc*-*-*"] {
+    # If there are powerpc targets to skip, do it here.
+
+    lappend DEFAULT_VECTCFLAGS "-maltivec"
+    if [check_vmx_hw_available] {
+            set dg-do-what-default run
+    } else {
+            if [is-effective-target ilp32] {
+                # Specify a cpu that supports VMX for compile-only tests.
+                lappend DEFAULT_VECTCFLAGS "-mcpu=7400"
+            }
+            set dg-do-what-default compile
+    }
+} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
+    lappend DEFAULT_VECTCFLAGS "-msse2"
+    set dg-do-what-default run
+} elseif [istarget "mipsisa64*-*-*"] {
+    lappend DEFAULT_VECTCFLAGS "-mpaired-single"
+    set dg-do-what-default run
+} elseif [istarget "sparc*-*-*"] {
+    lappend DEFAULT_VECTFLAGS "-mcpu=ultrasparc -mvis"
+    set dg-do-what-default run
+} else {
+    return
 }

 # Initialize `dg'.
 dg-init

 # Main loop.
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] ""
$DEFAULT_CFLAGS
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]]  \
+            "" $DEFAULT_VECTCFLAGS
+
+# Clean up.
+set dg-do-what-default ${save-dg-do-what-default}

 # All done.
 dg-finish





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