vect.exp: Enable tests to run on spu.
authorDorit Nuzman <dorit@il.ibm.com>
Sun, 3 Dec 2006 20:05:31 +0000 (20:05 +0000)
committerDorit Nuzman <dorit@gcc.gnu.org>
Sun, 3 Dec 2006 20:05:31 +0000 (20:05 +0000)
        * g++.dg/vect/vect.exp: Enable tests to run on spu.
        * gcc.dg/vect/vect.exp: Enable tests to run on spu.
        * gcc.dg/vect/no-section-anchors-vect-69.c: Reduce array size.
        * gcc.dg/vect/vect-70.c: Reduce array size.
        * gcc.dg/vect/fast-math-vect-reduc-7.c: Xfail for
        vect_no_compaer_double targets.
        * lib/target-supports.exp: Add spu to vect_no_align, no_vect_int_max,
        vect_float, vect_double, and vect_int.

* config/spu/spu.md (smaxv4sf3, sminv4sf3): New.

From-SVN: r119469

gcc/ChangeLog
gcc/config/spu/spu.md
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/vect/vect.exp
gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c
gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
gcc/testsuite/gcc.dg/vect/vect-70.c
gcc/testsuite/gcc.dg/vect/vect.exp
gcc/testsuite/lib/target-supports.exp

index d4f6b6ba725fadbfe330417404767e306ff279a1..cd810ff5be4962a4fe5919b7f793b50f2d56afe8 100644 (file)
@@ -1,3 +1,7 @@
+2006-12-03  Dorit Nuzman  <dorit@il.ibm.com>
+
+       * config/spu/spu.md (smaxv4sf3, sminv4sf3): New.
+
 2006-12-03  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/30041
index 417081b6711d8278a258a42efd8c4c2361d7bc5c..5ad43acd75cb359d1812d06d69f57b3e617af46e 100644 (file)
@@ -3300,3 +3300,31 @@ selb\t%0,%4,%0,%3"
 ;;
 (include "spu-builtins.md")
 
+  
+(define_expand "smaxv4sf3"
+  [(set (match_operand:V4SF 0 "register_operand" "=r")
+        (smax:V4SF (match_operand:V4SF 1 "register_operand" "r")
+                 (match_operand:V4SF 2 "register_operand" "r")))]
+  ""
+  "
+{
+  rtx mask = gen_reg_rtx (V4SImode);
+
+  emit_insn (gen_cgt_v4sf (mask, operands[1], operands[2]));
+  emit_insn (gen_selb (operands[0], operands[2], operands[1], mask));
+  DONE;
+}") 
+
+(define_expand "sminv4sf3"
+  [(set (match_operand:V4SF 0 "register_operand" "=r")
+        (smax:V4SF (match_operand:V4SF 1 "register_operand" "r")
+                 (match_operand:V4SF 2 "register_operand" "r")))]
+  ""
+  "
+{
+  rtx mask = gen_reg_rtx (V4SImode);
+
+  emit_insn (gen_cgt_v4sf (mask, operands[1], operands[2]));
+  emit_insn (gen_selb (operands[0], operands[1], operands[2], mask));
+  DONE;
+}") 
index 5adbc19ae45cd64fdc99fcb2bd79f002dd897f72..be7429ed75b28ebb1e7a9d9368b50736dbbb343c 100644 (file)
@@ -1,3 +1,14 @@
+2006-12-03  Dorit Nuzman  <dorit@il.ibm.com>
+
+       * g++.dg/vect/vect.exp: Enable tests to run on spu.
+       * gcc.dg/vect/vect.exp: Enable tests to run on spu.
+       * gcc.dg/vect/no-section-anchors-vect-69.c: Reduce array size.
+       * gcc.dg/vect/vect-70.c: Reduce array size.
+       * gcc.dg/vect/fast-math-vect-reduc-7.c: Xfail for 
+       vect_no_compaer_double targets.
+       * lib/target-supports.exp: Add spu to vect_no_align, no_vect_int_max,
+       vect_float, vect_double, and vect_int.
+
 2006-12-03  Dorit Nuzman <dorit@il.ibm.com>
 
        * gcc.dg/vect/pr16105.c: Remove xfail on vect_no_align targets. Add
index ce51c8a4f256b6b332d28fe68ddbcc788c67146a..6e8afa7475b3f8f7e1bf339609f86eb720aa87ba 100644 (file)
@@ -58,6 +58,8 @@ if [istarget "powerpc*-*-*"] {
         }
         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"
     set dg-do-what-default run
index b25e1145b1e8e356b29fa66ea5a687a21225931f..c88a8949d55d96a42a162c801d8c6f9ee1eccc9d 100644 (file)
@@ -50,5 +50,6 @@ int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_compare_double } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_no_compare_double } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
index 6da9bfbfdcc1a698241151ef732484c68ecfaa7d..7ed505b6f78599b47ddabc7765892dc7d65399e2 100644 (file)
@@ -3,7 +3,7 @@
 #include <stdarg.h>
 #include "tree-vect.h"
 
-#define N 32
+#define N 8
 
 struct s{
   int m;
@@ -113,5 +113,5 @@ int main (void)
 
 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
index cc2e4bd7fe3dcafea1b73e0253ca8874245d1212..4e209d4aecfeda494d540cae323fc19cb184e3e0 100644 (file)
@@ -3,7 +3,7 @@
 #include <stdarg.h>
 #include "tree-vect.h"
 
-#define N 16
+#define N 12
 
 struct s{
   int m;
index 49b3d8d4a2869bbacacbced0b8773cfe6bf24077..0de2be39a521acf820b6821f5c9a6a387956d419 100644 (file)
@@ -52,6 +52,8 @@ if [istarget "powerpc*-*-*"] {
        }
        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"
     set dg-do-what-default run
index e52139db9f969392113d1caae2777d04bdc8164a..4dd0b8e6e36e16cd159360e5b1f9f934535b6a07 100644 (file)
@@ -1249,6 +1249,7 @@ proc check_effective_target_vect_int { } {
        set et_vect_int_saved 0
        if { [istarget i?86-*-*]
              || [istarget powerpc*-*-*]
+             || [istarget spu-*-*]
              || [istarget x86_64-*-*]
              || [istarget sparc*-*-*]
              || [istarget alpha*-*-*]
@@ -1398,6 +1399,7 @@ proc check_effective_target_vect_float { } {
        set et_vect_float_saved 0
        if { [istarget i?86-*-*]
              || [istarget powerpc*-*-*]
+             || [istarget spu-*-*]
              || [istarget mipsisa64*-*-*]
              || [istarget x86_64-*-*]
              || [istarget ia64-*-*] } {
@@ -1421,7 +1423,8 @@ proc check_effective_target_vect_double { } {
     } else {
        set et_vect_double_saved 0
        if { [istarget i?86-*-*]
-             || [istarget x86_64-*-*] } {
+             || [istarget x86_64-*-*] 
+             || [istarget spu-*-*] } {
           set et_vect_double_saved 1
        }
     }
@@ -1430,6 +1433,26 @@ proc check_effective_target_vect_double { } {
     return $et_vect_double_saved
 }
 
+# Return 0 if the target supports hardware comparison of vectors of double, 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_vect_no_compare_double { } {
+    global et_vect_no_compare_double_saved
+
+    if [info exists et_vect_no_compare_double_saved] {
+        verbose "check_effective_target_vect_no_compare_double: using cached result" 2
+    } else {
+        set et_vect_no_compare_double_saved 0
+        if { [istarget spu-*-*] } {
+           set et_vect_no_compare_double_saved 1
+        }
+    }
+
+    verbose "check_effective_target_vect_no_compare_double: returning $et_vect_no_compare_double_saved" 2
+    return $et_vect_no_compare_double_saved
+}
+
 # Return 1 if the target plus current options does not support a vector
 # max instruction on "int", 0 otherwise.
 #
@@ -1443,6 +1466,7 @@ proc check_effective_target_vect_no_int_max { } {
     } else {
        set et_vect_no_int_max_saved 0
        if { [istarget sparc*-*-*]
+            || [istarget spu-*-*]
             || [istarget alpha*-*-*] } {
            set et_vect_no_int_max_saved 1
        }
@@ -1751,6 +1775,7 @@ proc check_effective_target_vect_no_align { } {
     } else {
        set et_vect_no_align_saved 0
        if { [istarget mipsisa64*-*-*]
+            || [istarget spu-*-*]
             || [istarget sparc*-*-*]
             || [istarget ia64-*-*] } {
            set et_vect_no_align_saved 1