OSDN Git Service

2010-11-22 Uros Bizjak <ubizjak@gmail.com>
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Nov 2010 21:49:19 +0000 (21:49 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Nov 2010 21:49:19 +0000 (21:49 +0000)
* gcc.dg/graphite/graphite.exp: Use check_vect_support_and_set_flags
for vectorizer tests.
* gcc.dg/graphite/vect-pr43423.c: Add "dg-do compile" dg directive.
* gcc.dg/graphite/pr40281.c: Remove "dg-do compile" dg directive.
* gcc.dg/graphite/pr41888.c: Ditto.
* gcc.dg/graphite/pr42729.c: Ditto.

2010-11-22  Mingjie Xing  <mingjie.xing@gmail.com>
    Uros Bizjak  <ubizjak@gmail.com>

* lib/target-supports.exp (check_vect_support_and_set_flags): New
procedure to check if the target supports vectorizer tests. Set
DEFAULT_VECTCFLAGS and dg-do-what-default depending on vectorization
capabilites.
* gcc.dg/vect/vect.exp: Use check_vect_support_and_set_flags.
* g++.dg/vect/vect.exp: Ditto.
* gfortran.dg/vect/vect.exp: Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167055 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/ChangeLog-2009
gcc/testsuite/g++.dg/vect/vect.exp
gcc/testsuite/gcc.dg/graphite/graphite.exp
gcc/testsuite/gcc.dg/graphite/pr40281.c
gcc/testsuite/gcc.dg/graphite/pr41888.c
gcc/testsuite/gcc.dg/graphite/pr42729.c
gcc/testsuite/gcc.dg/graphite/vect-pr43423.c
gcc/testsuite/gcc.dg/vect/vect.exp
gcc/testsuite/gfortran.dg/vect/vect.exp
gcc/testsuite/lib/target-supports.exp

index 274d408..ef33acb 100644 (file)
@@ -1,10 +1,30 @@
+2010-11-22  Uros Bizjak  <ubizjak@gmail.com>
+
+       * gcc.dg/graphite/graphite.exp: Use check_vect_support_and_set_flags
+       for vectorizer tests.
+       * gcc.dg/graphite/vect-pr43423.c: Add "dg-do compile" dg directive.
+       * gcc.dg/graphite/pr40281.c: Remove "dg-do compile" dg directive.
+       * gcc.dg/graphite/pr41888.c: Ditto.
+       * gcc.dg/graphite/pr42729.c: Ditto.
+
+2010-11-22  Mingjie Xing  <mingjie.xing@gmail.com>
+           Uros Bizjak  <ubizjak@gmail.com>
+
+       * lib/target-supports.exp (check_vect_support_and_set_flags): New
+       procedure to check if the target supports vectorizer tests. Set
+       DEFAULT_VECTCFLAGS and dg-do-what-default depending on vectorization
+       capabilites.
+       * gcc.dg/vect/vect.exp: Use check_vect_support_and_set_flags.
+       * g++.dg/vect/vect.exp: Ditto.
+       * gfortran.dg/vect/vect.exp: Ditto.
+
 2010-11-22  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        PR objc/34033
        * objc.dg/strings-1.m: New.
        * objc.dg/strings-2.m: New.
        * obj-c++.dg/strings-1.mm: New.
-       * obj-c++.dg/strings-2.mm: New. 
+       * obj-c++.dg/strings-2.mm: New.
 
 2010-11-22  Ian Bolton  <ian.bolton@arm.com>
 
index 005b4ac..a4614a0 100644 (file)
        * gcc.dg/tree-ssa/fre-vce-1.c: Cleanup "fre" tree dump.
        * gcc.dg/vect/vect-shift-2.c: Cleanup "vect" tree dump.
        * gcc.dg/vect/vect.exp (VECT_SLP_CFLAGS): Initialize with original
-       DEFAULT_VECTFLAGS.
+       DEFAULT_VECTCFLAGS.
 
 2009-06-21  Ira Rosen  <irar@il.ibm.com>
            Revital Eres  <eres@il.ibm.com>
index 90ae381..9a03f6c 100644 (file)
@@ -36,6 +36,7 @@ global dg-do-what-default
 set save-dg-do-what-default ${dg-do-what-default}
 
 # Set up flags used for tests that don't specify options.
+global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
 # These flags are used for all targets.
@@ -45,80 +46,7 @@ lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model" \
 # 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-*paired*"]  {
-   lappend DEFAULT_VECTCFLAGS "-mpaired"
-    if [check_750cl_hw_available] {
-        set dg-do-what-default run 
-    } else {
-        set dg-do-what-default compile
-    }
-} elseif [istarget "powerpc*-*-*"] {
-    # Skip targets not supporting -maltivec.
-    if ![is-effective-target powerpc_altivec_ok] {
-       return
-    }
-
-    lappend DEFAULT_VECTCFLAGS "-maltivec"
-    if [check_vsx_hw_available]  {
-      lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
-    }
-
-    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=970"
-       }
-       set dg-do-what-default compile
-    }
-} elseif { [istarget  "spu-*-*"] } {
-   set dg-do-what-default run
-} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
-    lappend DEFAULT_VECTCFLAGS "-msse2"
-    if { [check_effective_target_sse2_runtime] } {
-       set dg-do-what-default run
-    } else {
-       set dg-do-what-default compile
-    }
-} elseif { [istarget "mips*-*-*"]
-          && ([check_effective_target_mpaired_single]
-               || [check_effective_target_mips_loongson])
-          && [check_effective_target_nomips16] } {
-    if { [check_effective_target_mpaired_single] } {
-       lappend DEFAULT_VECTCFLAGS "-mpaired-single"
-    }
-    set dg-do-what-default run
-} elseif [istarget "sparc*-*-*"] {
-    lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
-    if [check_effective_target_ultrasparc_hw] {
-       set dg-do-what-default run
-    } else {
-       set dg-do-what-default compile
-    }
-} elseif [istarget "alpha*-*-*"] {
-    # Alpha's vectorization capabilities are extremely limited.
-    # It's more effort than its worth disabling all of the tests
-    # that it cannot pass.  But if you actually want to see what
-    # does work, command out the return.
-    return
-
-    lappend DEFAULT_VECTCFLAGS "-mmax"
-    if [check_alpha_max_hw_available] {
-       set dg-do-what-default run
-    } else {
-       set dg-do-what-default compile
-    }
-} elseif [istarget "ia64-*-*"] {
-    set dg-do-what-default run
-} elseif [is-effective-target arm_neon_ok] {
-    eval lappend DEFAULT_VECTCFLAGS [add_options_for_arm_neon ""]
-    if [is-effective-target arm_neon_hw] {
-      set dg-do-what-default run
-    } else {
-      set dg-do-what-default compile
-    }
-} else {
+if ![check_vect_support_and_set_flags] {
     return
 }
 
index e6cdf12..2111e38 100644 (file)
@@ -49,7 +49,6 @@ set vect_files        [lsort [glob -nocomplain $srcdir/$subdir/vect-*.c ] ]
 set dg-do-what-default compile
 dg-runtest $scop_files        "" "-O2 -fgraphite -fdump-tree-graphite-all"
 dg-runtest $id_files          "" "-O2 -fgraphite-identity -ffast-math"
-dg-runtest $vect_files        "" "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details"
 
 # Tests to be run.
 set dg-do-what-default run
@@ -57,6 +56,14 @@ dg-runtest $run_id_files      "" "-O2 -fgraphite-identity"
 dg-runtest $interchange_files "" "-O2 -floop-interchange -fno-loop-block -fno-loop-strip-mine -ffast-math -fdump-tree-graphite-all"
 dg-runtest $block_files       "" "-O2 -floop-block -fno-loop-strip-mine -fno-loop-interchange -ffast-math -fdump-tree-graphite-all"
 
+# Vectorizer tests, to be run or compiled, depending on target capabilities.
+global DEFAULT_VECTCFLAGS
+set DEFAULT_VECTCFLAGS "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details"
+
+if [check_vect_support_and_set_flags] {
+    dg-runtest $vect_files        "" $DEFAULT_VECTCFLAGS
+}
+
 # The default action for the rest of the files is 'compile'.
 set dg-do-what-default compile
 foreach f $scop_files        {lremove wait_to_run_files $f}
index 437f343..255546b 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do compile } */
 /* { dg-options "-O -fprefetch-loop-arrays -w" } */
 /* { dg-options "-O -fprefetch-loop-arrays -march=i686 -msse -w" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
 /* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
index b262af6..45df7df 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do compile } */
 /* { dg-options "-g -O2 -ftree-loop-distribution -fgraphite-identity" } */
 
 int
index 3a0e901..a9f1e2d 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do compile } */
 /* { dg-options "-O1 -fgraphite-identity -fcompare-debug" } */
 
 int A[10];
index 5589167..bd685a6 100644 (file)
@@ -1,3 +1,4 @@
+/* { dg-do compile } */
 /* { dg-require-effective-target vect_int } */
 
 int a[100], b[100], c[100];
index 5160020..170c33d 100644 (file)
@@ -21,6 +21,7 @@
 load_lib gcc-dg.exp
 
 # Set up flags used for tests that don't specify options.
+global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
 # If the target system supports vector instructions, the default action
@@ -34,84 +35,7 @@ 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-*paired*"]  {
-   lappend DEFAULT_VECTCFLAGS "-mpaired"
-    if [check_750cl_hw_available] {
-        set dg-do-what-default run 
-    } else {
-        set dg-do-what-default compile
-    }
-} elseif [istarget "powerpc*-*-*"] {
-    # Skip targets not supporting -maltivec.
-    if ![is-effective-target powerpc_altivec_ok] {
-       return
-    }
-
-    lappend DEFAULT_VECTCFLAGS "-maltivec"
-    if [check_vsx_hw_available]  {
-      lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
-    }
-
-    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=970"
-       }
-       set dg-do-what-default compile
-    }
-} elseif { [istarget  "spu-*-*"] } {
-   set dg-do-what-default run
-} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
-    lappend DEFAULT_VECTCFLAGS "-msse2"
-    if { [check_effective_target_sse2_runtime] } {
-       set dg-do-what-default run
-    } else {
-       set dg-do-what-default compile
-    }
-} elseif { [istarget "mips*-*-*"]
-          && ([check_effective_target_mpaired_single]
-               || [check_effective_target_mips_loongson])
-          && [check_effective_target_nomips16] } {
-    if { [check_effective_target_mpaired_single] } {
-       lappend DEFAULT_VECTCFLAGS "-mpaired-single"
-    }
-    set dg-do-what-default run
-} elseif [istarget "sparc*-*-*"] {
-    lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
-    if [check_effective_target_ultrasparc_hw] {
-       set dg-do-what-default run
-    } else {
-       set dg-do-what-default compile
-    }
-} elseif [istarget "alpha*-*-*"] {
-    # Alpha's vectorization capabilities are extremely limited.
-    # It's more effort than its worth disabling all of the tests
-    # that it cannot pass.  But if you actually want to see what
-    # does work, command out the return.
-    return
-
-    lappend DEFAULT_VECTCFLAGS "-mmax"
-    if [check_alpha_max_hw_available] {
-       set dg-do-what-default run
-    } else {
-       set dg-do-what-default compile
-    }
-} elseif [istarget "ia64-*-*"] {
-    set dg-do-what-default run
-} elseif [is-effective-target arm_neon_ok] {
-    eval lappend DEFAULT_VECTCFLAGS [add_options_for_arm_neon ""]
-    # NEON does not support denormals, so is not used for vectorization by
-    # default to avoid loss of precision.  We must pass -ffast-math to test
-    # vectorization of float operations.
-    lappend DEFAULT_VECTCFLAGS "-ffast-math"
-    if [is-effective-target arm_neon_hw] {
-      set dg-do-what-default run
-    } else {
-      set dg-do-what-default compile
-    }
-} else {
+if ![check_vect_support_and_set_flags] {
     return
 }
 
index d261376..11bcecd 100644 (file)
@@ -21,6 +21,7 @@ load_lib gfortran-dg.exp
 load_lib target-supports.exp
 
 # Set up flags used for tests that don't specify options.
+global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
 # These flags are used for all targets.
@@ -38,80 +39,7 @@ 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-*paired*"]  {
-   lappend DEFAULT_VECTCFLAGS "-mpaired"
-    if [check_750cl_hw_available] {
-        set dg-do-what-default run 
-    } else {
-        set dg-do-what-default compile
-    }
-} elseif [istarget "powerpc*-*-*"] {
-    # Skip targets not supporting -maltivec.
-    if ![is-effective-target powerpc_altivec_ok] {
-       return
-    }
-
-    lappend DEFAULT_VECTCFLAGS "-maltivec"
-    if [check_vsx_hw_available]  {
-      lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
-    }
-
-    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=970"
-       }
-       set dg-do-what-default compile
-    }
-} elseif { [istarget  "spu-*-*"] } {
-   set dg-do-what-default run
-} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
-    lappend DEFAULT_VECTCFLAGS "-msse2"
-    if { [check_effective_target_sse2_runtime] } {
-       set dg-do-what-default run
-    } else {
-       set dg-do-what-default compile
-    }
-} elseif { [istarget "mips*-*-*"]
-          && ([check_effective_target_mpaired_single]
-               || [check_effective_target_mips_loongson])
-          && [check_effective_target_nomips16] } {
-    if { [check_effective_target_mpaired_single] } {
-       lappend DEFAULT_VECTCFLAGS "-mpaired-single"
-    }
-    set dg-do-what-default run
-} elseif [istarget "sparc*-*-*"] {
-    lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
-    if [check_effective_target_ultrasparc_hw] {
-       set dg-do-what-default run
-    } else {
-       set dg-do-what-default compile
-    }
-} elseif [istarget "alpha*-*-*"] {
-    # Alpha's vectorization capabilities are extremely limited.
-    # It's more effort than its worth disabling all of the tests
-    # that it cannot pass.  But if you actually want to see what
-    # does work, command out the return.
-    return
-
-    lappend DEFAULT_VECTCFLAGS "-mmax"
-    if [check_alpha_max_hw_available] {
-       set dg-do-what-default run
-    } else {
-       set dg-do-what-default compile
-    }
-} elseif [istarget "ia64-*-*"] {
-    set dg-do-what-default run
-} elseif [is-effective-target arm_neon_ok] {
-    eval lappend DEFAULT_VECTCFLAGS [add_options_for_arm_neon ""]
-    if [is-effective-target arm_neon_hw] {
-      set dg-do-what-default run
-    } else {
-      set dg-do-what-default compile
-    }
-} else {
+if ![check_vect_support_and_set_flags] {
     return
 }
 
index 50039e0..c443312 100644 (file)
@@ -3768,3 +3768,98 @@ proc check_effective_target_run_expensive_tests { } {
 proc check_effective_target_mempcpy {} {
     return [check_function_available "mempcpy"]
 }
+
+# Check whether the vectorizer tests are supported by the target and
+# append additional target-dependent compile flags to DEFAULT_VECTCFLAGS.
+# Set dg-do-what-default to either compile or run, depending on target
+# capabilities.  Return 1 if vectorizer tests are supported by
+# target, 0 otherwise.
+
+proc check_vect_support_and_set_flags { } {
+    global DEFAULT_VECTCFLAGS
+    global dg-do-what-default
+
+    if  [istarget "powerpc-*paired*"]  {
+        lappend DEFAULT_VECTCFLAGS "-mpaired"
+        if [check_750cl_hw_available] {
+            set dg-do-what-default run
+        } else {
+            set dg-do-what-default compile
+        }
+    } elseif [istarget "powerpc*-*-*"] {
+        # Skip targets not supporting -maltivec.
+        if ![is-effective-target powerpc_altivec_ok] {
+            return 0
+        }
+
+        lappend DEFAULT_VECTCFLAGS "-maltivec"
+        if [check_vsx_hw_available]  {
+            lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
+        }
+
+        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=970"
+            }
+            set dg-do-what-default compile
+        }
+    } elseif { [istarget  "spu-*-*"] } {
+        set dg-do-what-default run
+    } elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
+        lappend DEFAULT_VECTCFLAGS "-msse2"
+        if { [check_effective_target_sse2_runtime] } {
+            set dg-do-what-default run
+        } else {
+            set dg-do-what-default compile
+        }
+    } elseif { [istarget "mips*-*-*"]
+               && ([check_effective_target_mpaired_single]
+                    || [check_effective_target_mips_loongson])
+               && [check_effective_target_nomips16] } {
+        if { [check_effective_target_mpaired_single] } {
+            lappend DEFAULT_VECTCFLAGS "-mpaired-single"
+        }
+        set dg-do-what-default run
+    } elseif [istarget "sparc*-*-*"] {
+        lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
+        if [check_effective_target_ultrasparc_hw] {
+            set dg-do-what-default run
+        } else {
+            set dg-do-what-default compile
+        }
+    } elseif [istarget "alpha*-*-*"] {
+        # Alpha's vectorization capabilities are extremely limited.
+        # It's more effort than its worth disabling all of the tests
+        # that it cannot pass.  But if you actually want to see what
+        # does work, command out the return.
+        return 0
+
+        lappend DEFAULT_VECTCFLAGS "-mmax"
+        if [check_alpha_max_hw_available] {
+            set dg-do-what-default run
+        } else {
+            set dg-do-what-default compile
+        }
+    } elseif [istarget "ia64-*-*"] {
+        set dg-do-what-default run
+    } elseif [is-effective-target arm_neon_ok] {
+        eval lappend DEFAULT_VECTCFLAGS [add_options_for_arm_neon ""]
+        # NEON does not support denormals, so is not used for vectorization by
+        # default to avoid loss of precision.  We must pass -ffast-math to test
+        # vectorization of float operations.
+        lappend DEFAULT_VECTCFLAGS "-ffast-math"
+        if [is-effective-target arm_neon_hw] {
+            set dg-do-what-default run
+        } else {
+            set dg-do-what-default compile
+        }
+    } else {
+        return 0
+    }
+
+    return 1
+}
+