public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ira Rosen <IRAR@il.ibm.com>
To: gcc-patches@gcc.gnu.org
Cc: Revital1 Eres <ERES@il.ibm.com>
Subject: [patch, testsuite] Fix vectorizer testcases
Date: Mon, 08 Oct 2007 11:33:00 -0000	[thread overview]
Message-ID: <OF9216186E.713564B2-ONC2257367.00471639-C225736E.003F69F1@il.ibm.com> (raw)

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


Fix vectorizer testcases mainly to pass on SPU and 750cl.

Tested on SPU and PowerPC.
O.K. for mainline?

Thanks,
Revital and Ira

ChangeLog entry:

      * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int.
      * gcc.dg/vect/pr33369.c: Likewise.
      * gcc.dg/vect/slp-33.c: Add spaces.
      * gcc.dg/vect/no-scevccp-outer-18.c: Target vect_interleave.
      * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int.
      * gcc.dg/vect/no-scevccp-outer-19.c: Xfail on vect_no_shortint_cvt.
      * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int.
      * gcc.dg/vect/vect-strided-store-u16-i4.c: Target
!vect_no_shortint_cvt.
      * gcc.dg/vect/slp-10.c: Add spaces.
      * gcc.dg/vect/no-scevccp-outer-21.c: Xfail on vect_no_intshort_cvt.
      * gcc.dg/vect/slp-36.c: Require vect_int.
      * gcc.dg/vect/vect-strided-store-u32-i2.c,
gcc.dg/vect/vect-ifcvt-2.c,
      gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c,
      gcc.dg/vect/vect-83.c: Likewise.
      * gcc.dg/vect/no-scevccp-outer-16.c: Xfail on vect_no_shortint_cvt.
      * gcc.dg/vect/no-scevccp-outer-17.c: Likewise.
      * lib/target-supports.exp (vect_no_intshort_cvt): New.
      (vect_no_shortint_cvt): New.
      (vect_aligned_arrays): Depend on natural_alignment_32.
      (natural_alignment): Split into...
      (natural_alignment_32, natural_alignment_64): New.
      (alignment_reachable_for_double): Depend on natural_alignment_64.

(See attached file: tests.txt)


[-- Attachment #2: tests.txt --]
[-- Type: text/plain, Size: 14850 bytes --]

Index: gcc.dg/vect/vect-ifcvt-5.c
===================================================================
--- gcc.dg/vect/vect-ifcvt-5.c	(revision 128708)
+++ gcc.dg/vect/vect-ifcvt-5.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
 
 #include <stdarg.h>
 #include <signal.h>
Index: gcc.dg/vect/pr33369.c
===================================================================
--- gcc.dg/vect/pr33369.c	(revision 128708)
+++ gcc.dg/vect/pr33369.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
 /* { dg-require-effective-target vect_shift } */
 
 typedef struct tagPOINT
Index: gcc.dg/vect/slp-33.c
===================================================================
--- gcc.dg/vect/slp-33.c	(revision 128708)
+++ gcc.dg/vect/slp-33.c	(working copy)
@@ -104,9 +104,9 @@
 
 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect"  {target {vect_intfloat_cvt && vect_int_mult} } } } */
 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect"  {target {{! { vect_intfloat_cvt}} && vect_int_mult} } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect"  {target {{! { vect_intfloat_cvt}} && {!{vect_int_mult}}} } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect"  {target {{! { vect_intfloat_cvt}} && {! {vect_int_mult}}} } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" {target {vect_intfloat_cvt && vect_int_mult} } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect"  {target {{! { vect_intfloat_cvt}} && vect_int_mult} } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect"  {target {{! { vect_intfloat_cvt}} && {!{vect_int_mult}}} } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect"  {target {{! { vect_intfloat_cvt}} && {! {vect_int_mult}}} } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
   
Index: gcc.dg/vect/no-scevccp-outer-18.c
===================================================================
--- gcc.dg/vect/no-scevccp-outer-18.c	(revision 128708)
+++ gcc.dg/vect/no-scevccp-outer-18.c	(working copy)
@@ -47,5 +47,5 @@
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_interleave } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc.dg/vect/vect-ifcvt-6.c
===================================================================
--- gcc.dg/vect/vect-ifcvt-6.c	(revision 128708)
+++ gcc.dg/vect/vect-ifcvt-6.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
 
 #include <stdarg.h>
 #include <signal.h>
Index: gcc.dg/vect/no-scevccp-outer-19.c
===================================================================
--- gcc.dg/vect/no-scevccp-outer-19.c	(revision 128708)
+++ gcc.dg/vect/no-scevccp-outer-19.c	(working copy)
@@ -48,5 +48,5 @@
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail vect_no_shortint_cvt } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc.dg/vect/vect-ifcvt-7.c
===================================================================
--- gcc.dg/vect/vect-ifcvt-7.c	(revision 128708)
+++ gcc.dg/vect/vect-ifcvt-7.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
 
 #include <stdarg.h>
 #include <signal.h>
Index: gcc.dg/vect/vect-strided-store-u16-i4.c
===================================================================
--- gcc.dg/vect/vect-strided-store-u16-i4.c	(revision 128708)
+++ gcc.dg/vect/vect-strided-store-u16-i4.c	(working copy)
@@ -65,8 +65,8 @@
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect"  { target { vect_interleave } } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { ! { vect_interleave } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect"  { target { { vect_interleave } && { ! { vect_no_intshort_cvt } } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { { ! { vect_interleave } } && { ! { vect_no_intshort_cvt } }  } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
 
Index: gcc.dg/vect/slp-10.c
===================================================================
--- gcc.dg/vect/slp-10.c	(revision 128708)
+++ gcc.dg/vect/slp-10.c	(working copy)
@@ -106,9 +106,9 @@
 
 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect"  {target {vect_intfloat_cvt && vect_int_mult} } } } */
 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect"  {target {{! { vect_intfloat_cvt}} && vect_int_mult} } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect"  {target {{! { vect_intfloat_cvt}} && {!{vect_int_mult}}} } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect"  {target {{! { vect_intfloat_cvt}} && { ! {vect_int_mult}}} } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" {target {vect_intfloat_cvt && vect_int_mult} } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect"  {target {{! { vect_intfloat_cvt}} && vect_int_mult} } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect"  {target {{! { vect_intfloat_cvt}} && {!{vect_int_mult}}} } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect"  {target {{! { vect_intfloat_cvt}} && { ! {vect_int_mult}}} } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
   
Index: gcc.dg/vect/no-scevccp-outer-21.c
===================================================================
--- gcc.dg/vect/no-scevccp-outer-21.c	(revision 128708)
+++ gcc.dg/vect/no-scevccp-outer-21.c	(working copy)
@@ -58,5 +58,5 @@
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail vect_no_intshort_cvt } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc.dg/vect/slp-36.c
===================================================================
--- gcc.dg/vect/slp-36.c	(revision 128708)
+++ gcc.dg/vect/slp-36.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
 /* { dg-require-effective-target vect_shift } */
 
 #define N 32
Index: gcc.dg/vect/vect-strided-store-u32-i2.c
===================================================================
--- gcc.dg/vect/vect-strided-store-u32-i2.c	(revision 128708)
+++ gcc.dg/vect/vect-strided-store-u32-i2.c	(working copy)
@@ -1,4 +1,4 @@
-/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_int } */
 
 #include <stdarg.h>
 #include <stdio.h>
Index: gcc.dg/vect/vect-ifcvt-2.c
===================================================================
--- gcc.dg/vect/vect-ifcvt-2.c	(revision 128708)
+++ gcc.dg/vect/vect-ifcvt-2.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
 
 #include <stdarg.h>
 #include <signal.h>
Index: gcc.dg/vect/vect-ifcvt-3.c
===================================================================
--- gcc.dg/vect/vect-ifcvt-3.c	(revision 128708)
+++ gcc.dg/vect/vect-ifcvt-3.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
 
 #include <stdarg.h>
 #include <signal.h>
Index: gcc.dg/vect/no-scevccp-outer-16.c
===================================================================
--- gcc.dg/vect/no-scevccp-outer-16.c	(revision 128708)
+++ gcc.dg/vect/no-scevccp-outer-16.c	(working copy)
@@ -58,5 +58,5 @@
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail vect_no_shortint_cvt } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc.dg/vect/vect-82.c
===================================================================
--- gcc.dg/vect/vect-82.c	(revision 128708)
+++ gcc.dg/vect/vect-82.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do run { target powerpc*-*-* } } */
+/* { dg-require-effective-target vect_int } */
 
 #include <stdarg.h>
 #include "tree-vect.h"
Index: gcc.dg/vect/no-scevccp-outer-17.c
===================================================================
--- gcc.dg/vect/no-scevccp-outer-17.c	(revision 128708)
+++ gcc.dg/vect/no-scevccp-outer-17.c	(working copy)
@@ -64,5 +64,5 @@
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail vect_no_shortint_cvt } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc.dg/vect/vect-83.c
===================================================================
--- gcc.dg/vect/vect-83.c	(revision 128708)
+++ gcc.dg/vect/vect-83.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do run { target powerpc*-*-* } } */
+/* { dg-require-effective-target vect_int } */
 
 #include <stdarg.h>
 #include "tree-vect.h"
Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 128708)
+++ lib/target-supports.exp	(working copy)
@@ -1499,7 +1499,45 @@
     return $et_vect_floatint_cvt_saved
 }
 
+# Return 1 if the target doesn't support int->short conversion
+#
 
+proc check_effective_target_vect_no_intshort_cvt { } {
+    global et_vect_no_intshort_cvt_saved
+
+    if [info exists et_vect_no_intshort_cvt_saved] {
+        verbose "check_effective_target_vect_no_intshort_cvt: using cached result" 2
+    } else {
+        set et_vect_no_intshort_cvt_saved 0
+        if { [istarget spu-*-*] } {
+           set et_vect_no_intshort_cvt_saved 1
+        }
+    }
+
+    verbose "check_effective_target_vect_no_intshort_cvt: returning $et_vect_no_intshort_cvt_saved" 2
+    return $et_vect_no_intshort_cvt_saved
+}
+
+
+# Return 1 if the target doesn't support short->int conversion
+#
+
+proc check_effective_target_vect_no_shortint_cvt { } {
+    global et_vect_no_shortint_cvt_saved
+
+    if [info exists et_vect_no_shortint_cvt_saved] {
+        verbose "check_effective_target_vect_no_shortint_cvt: using cached result" 2
+    } else {
+        set et_vect_no_shortint_cvt_saved 0
+        if { [istarget spu-*-*] } {
+           set et_vect_no_shortint_cvt_saved 1
+        }
+    }
+
+    verbose "check_effective_target_vect_no_shortint_cvt: returning $et_vect_no_shortint_cvt_saved" 2
+    return $et_vect_no_shortint_cvt_saved
+}
+
 # Return 1 is this is an arm target using 32-bit instructions
 proc check_effective_target_arm32 { } {
     return [check_no_compiler_messages arm32 assembly {
@@ -2135,7 +2173,7 @@
     } else {
 	set et_vect_aligned_arrays_saved 0
 	if { ([istarget x86_64-*-*]
-	      || [istarget i?86-*-*]) && [is-effective-target lp64] } {
+	      || [istarget i?86-*-*]) && [is-effective-target lp64] } { 
 	    set et_vect_aligned_arrays_saved 1
 	}
     }
@@ -2143,27 +2181,49 @@
     return $et_vect_aligned_arrays_saved
 }
 
-# Return 1 if types are naturally aligned (aligned to their type-size),
-# 0 otherwise.
+# Return 1 if types (32 bit and less types) are naturally aligned 
+# (aligned to their type-size), 0 otherwise.
 #
 # This won't change for different subtargets so cache the result.
 
-proc check_effective_target_natural_alignment { } {
-    global et_natural_alignment
+proc check_effective_target_natural_alignment_32 { } {
+    global et_natural_alignment_32
 
-    if [info exists et_natural_alignment_saved] {
-        verbose "check_effective_target_natural_alignment: using cached result" 2
+    if [info exists et_natural_alignment_32_saved] {
+        verbose "check_effective_target_natural_alignment_32: using cached result" 2
     } else {
 	# FIXME: 32bit powerpc: guaranteed only if MASK_ALIGN_NATURAL/POWER.
-        set et_natural_alignment_saved 1
+        set et_natural_alignment_32_saved 1
         if { ([istarget *-*-darwin*] && [is-effective-target lp64]) } { 
-            set et_natural_alignment_saved 0
+            set et_natural_alignment_32_saved 0
         }
     }
-    verbose "check_effective_target_natural_alignment: returning $et_natural_alignment_saved" 2
-    return $et_natural_alignment_saved
+    verbose "check_effective_target_natural_alignment_32: returning $et_natural_alignment_32_saved" 2
+    return $et_natural_alignment_32_saved
 }
 
+# Return 1 if types (64 bit and less) are naturally aligned (aligned to their 
+# type-size), 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_natural_alignment_64 { } {
+    global et_natural_alignment_64
+
+    if [info exists et_natural_alignment_64_saved] {
+        verbose "check_effective_target_natural_alignment_64: using cached result" 2
+    } else {
+        set et_natural_alignment_64_saved 0
+        if { ([is-effective-target lp64] && ![istarget *-*-darwin*])
+             || [istarget spu-*-*] } {
+            set et_natural_alignment_64_saved 1
+        }
+    }
+    verbose "check_effective_target_natural_alignment_64: returning $et_natural_alignment_64_saved" 2
+    return $et_natural_alignment_64_saved
+}
+
+
 # Return 1 if vector alignment is reachable, 0 otherwise.
 #
 # This won't change for different subtargets so cache the result.
@@ -2175,7 +2235,7 @@
         verbose "check_effective_target_vector_alignment_reachable: using cached result" 2
     } else {
         if { [check_effective_target_vect_aligned_arrays]
-             || [check_effective_target_natural_alignment] } {
+             || [check_effective_target_natural_alignment_32] } {
             set et_vector_alignment_reachable_saved 1
         } else {
             set et_vector_alignment_reachable_saved 0
@@ -2195,7 +2255,8 @@
     if [info exists et_vector_alignment_reachable_for_double_saved] {
         verbose "check_effective_target_vector_alignment_reachable_for_double: using cached result" 2
     } else {
-        if { [check_effective_target_vect_aligned_arrays] } {
+        if { [check_effective_target_vect_aligned_arrays]
+              || [check_effective_target_natural_alignment_64] } {
             set et_vector_alignment_reachable_for_double_saved 1
         } else {
             set et_vector_alignment_reachable_for_double_saved 0

             reply	other threads:[~2007-10-08 11:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-08 11:33 Ira Rosen [this message]
2007-10-09  9:21 ` Dorit Nuzman
2007-10-29  8:28 Revital1 Eres
2007-10-30  8:27 ` Dorit Nuzman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF9216186E.713564B2-ONC2257367.00471639-C225736E.003F69F1@il.ibm.com \
    --to=irar@il.ibm.com \
    --cc=ERES@il.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).