public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, testsuite] Fixed generic vectorization testcase for Cell SPU
@ 2008-06-22  9:13 Ira Rosen
  2008-06-22  9:48 ` Andrew Pinski
  0 siblings, 1 reply; 9+ messages in thread
From: Ira Rosen @ 2008-06-22  9:13 UTC (permalink / raw)
  To: gcc-patches


Hi,

gcc.dg/tree-ssa/gen-vect-11c.c, as well as other gen-vect-* testcases,
needs to be ran without SIMD extension, which is impossible on SPU.
Therefore, the loop in this testcase gets vectorized (using regular
vectorization) and the test fails. This patch adds xfail for SPU to the
testcase.

Tested on Cell SPU. O.K. for 4.3.2 and mainline?

Thanks,
Ira

ChangeLog:

      * gcc.dg/tree-ssa/gen-vect-11c.c: Vectorizable on Cell SPU.

Index: testsuite/gcc.dg/tree-ssa/gen-vect-11c.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/gen-vect-11c.c    (revision 136939)
+++ testsuite/gcc.dg/tree-ssa/gen-vect-11c.c    (working copy)
@@ -36,5 +36,5 @@ int main ()
 }


-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail
spu-*-* } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch, testsuite] Fixed generic vectorization testcase for Cell SPU
  2008-06-22  9:13 [patch, testsuite] Fixed generic vectorization testcase for Cell SPU Ira Rosen
@ 2008-06-22  9:48 ` Andrew Pinski
  2008-06-22 10:37   ` Ira Rosen
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Pinski @ 2008-06-22  9:48 UTC (permalink / raw)
  To: Ira Rosen; +Cc: gcc-patches

Sent from my iPhone

On Jun 22, 2008, at 1:57, Ira Rosen <IRAR@il.ibm.com> wrote:

>
> Hi,
>
> gcc.dg/tree-ssa/gen-vect-11c.c, as well as other gen-vect-* testcases,
> needs to be ran without SIMD extension, which is impossible on SPU.
> Therefore, the loop in this testcase gets vectorized (using regular
> vectorization) and the test fails. This patch adds xfail for SPU to  
> the
> testcase.
>
> Tested on Cell SPU. O.K. for 4.3.2 and mainline?

How about just skiping these tests on spu instead?  Since really this  
is not a really a xfail since the test is testing the wrong thing on  
spu.

Thanks,
Andrew Pinski

>
>
> Thanks,
> Ira
>
> ChangeLog:
>
>      * gcc.dg/tree-ssa/gen-vect-11c.c: Vectorizable on Cell SPU.
>
> Index: testsuite/gcc.dg/tree-ssa/gen-vect-11c.c
> ===================================================================
> --- testsuite/gcc.dg/tree-ssa/gen-vect-11c.c    (revision 136939)
> +++ testsuite/gcc.dg/tree-ssa/gen-vect-11c.c    (working copy)
> @@ -36,5 +36,5 @@ int main ()
> }
>
>
> -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1  
> "vect" } } */
> +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1  
> "vect" { xfail
> spu-*-* } } } */
> /* { dg-final { cleanup-tree-dump "vect" } } */
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch, testsuite] Fixed generic vectorization testcase for Cell SPU
  2008-06-22  9:48 ` Andrew Pinski
@ 2008-06-22 10:37   ` Ira Rosen
  2008-06-22 11:30     ` Joseph S. Myers
  0 siblings, 1 reply; 9+ messages in thread
From: Ira Rosen @ 2008-06-22 10:37 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc-patches

Andrew Pinski <pinskia@gmail.com> wrote on 22/06/2008 12:12:44:

> How about just skiping these tests on spu instead?  Since really this
> is not a really a xfail since the test is testing the wrong thing on
> spu.
>

Right. Here is the patch.

Thanks,
Ira

ChangeLog:

      * gcc.dg/tree-ssa/gen-vect-11.c: Disable on SPU.
      * gcc.dg/tree-ssa/gen-vect-2.c, gcc.dg/tree-ssa/gen-vect-32.c,.
      gcc.dg/tree-ssa/gen-vect-25.c, gcc.dg/tree-ssa/gen-vect-11a.c,
      gcc.dg/tree-ssa/gen-vect-26.c, gcc.dg/tree-ssa/gen-vect-11b.c,
      gcc.dg/tree-ssa/gen-vect-11c.c, gcc.dg/tree-ssa/gen-vect-28.c:,
      Likewise.

Index: testsuite/gcc.dg/tree-ssa/gen-vect-11.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/gen-vect-11.c     (revision 136939)
+++ testsuite/gcc.dg/tree-ssa/gen-vect-11.c     (working copy)
@@ -1,4 +1,4 @@
-/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-do run { target { vect_cmdline_needed && !spu-*-* } } } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fwrapv
-fdump-tree-vect-stats" } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fwrapv
-fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */

Index: testsuite/gcc.dg/tree-ssa/gen-vect-2.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/gen-vect-2.c      (revision 136939)
+++ testsuite/gcc.dg/tree-ssa/gen-vect-2.c      (working copy)
@@ -1,4 +1,4 @@
-/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-do run { target { vect_cmdline_needed && !spu-*-* } } } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4
-fdump-tree-vect-stats" } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4
-fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */}

Index: testsuite/gcc.dg/tree-ssa/gen-vect-32.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/gen-vect-32.c     (revision 136939)
+++ testsuite/gcc.dg/tree-ssa/gen-vect-32.c     (working copy)
@@ -1,4 +1,4 @@
-/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-do run { target { vect_cmdline_needed && !spu-*-* } } } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4
-fdump-tree-vect-stats" } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4
-fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */}

Index: testsuite/gcc.dg/tree-ssa/gen-vect-25.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/gen-vect-25.c     (revision 136939)
+++ testsuite/gcc.dg/tree-ssa/gen-vect-25.c     (working copy)
@@ -1,4 +1,4 @@
-/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-do run { target { vect_cmdline_needed && !spu-*-* } } } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4
-fdump-tree-vect-stats" } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4
-fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */}

Index: testsuite/gcc.dg/tree-ssa/gen-vect-11a.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/gen-vect-11a.c    (revision 136939)
+++ testsuite/gcc.dg/tree-ssa/gen-vect-11a.c    (working copy)
@@ -1,4 +1,4 @@
-/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-do run { target { vect_cmdline_needed && !spu-*-* } } } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3
-fdump-tree-vect-stats" } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3
-fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */}

Index: testsuite/gcc.dg/tree-ssa/gen-vect-26.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/gen-vect-26.c     (revision 136939)
+++ testsuite/gcc.dg/tree-ssa/gen-vect-26.c     (working copy)
@@ -1,4 +1,4 @@
-/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-do run { target { vect_cmdline_needed && !spu-*-* } } } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4
-fdump-tree-vect-stats" } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4
-fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */}

Index: testsuite/gcc.dg/tree-ssa/gen-vect-11b.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/gen-vect-11b.c    (revision 136939)
+++ testsuite/gcc.dg/tree-ssa/gen-vect-11b.c    (working copy)
@@ -1,4 +1,4 @@
-/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-do run { target { vect_cmdline_needed && !spu-*-* } } } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3
-fdump-tree-vect-stats" } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3
-fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */}

Index: testsuite/gcc.dg/tree-ssa/gen-vect-11c.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/gen-vect-11c.c    (revision 136939)
+++ testsuite/gcc.dg/tree-ssa/gen-vect-11c.c    (working copy)
@@ -1,4 +1,4 @@
-/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-do run { target { vect_cmdline_needed  && !spu-*-* } } } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3
-fdump-tree-vect-stats" } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3
-fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */}

@@ -36,5 +36,5 @@ int main ()
 }


-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect"  } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: testsuite/gcc.dg/tree-ssa/gen-vect-28.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/gen-vect-28.c     (revision 136939)
+++ testsuite/gcc.dg/tree-ssa/gen-vect-28.c     (working copy)
@@ -1,4 +1,4 @@
-/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-do run { target { vect_cmdline_needed && !spu-*-* } } } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4
-fdump-tree-vect-stats" } */
 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4
-fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */}



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch, testsuite] Fixed generic vectorization testcase for Cell  SPU
  2008-06-22 10:37   ` Ira Rosen
@ 2008-06-22 11:30     ` Joseph S. Myers
  2008-06-22 11:34       ` Ira Rosen
  0 siblings, 1 reply; 9+ messages in thread
From: Joseph S. Myers @ 2008-06-22 11:30 UTC (permalink / raw)
  To: Ira Rosen; +Cc: Andrew Pinski, gcc-patches

On Sun, 22 Jun 2008, Ira Rosen wrote:

> Andrew Pinski <pinskia@gmail.com> wrote on 22/06/2008 12:12:44:
> 
> > How about just skiping these tests on spu instead?  Since really this
> > is not a really a xfail since the test is testing the wrong thing on
> > spu.
> >
> 
> Right. Here is the patch.

The correct way to skip them is to modify 
check_effective_target_vect_cmdline_needed in target-supports.exp to know 
that SPU does not need command-line options to vectorize, not to modify 
the individual tests.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch, testsuite] Fixed generic vectorization testcase for Cell  SPU
  2008-06-22 11:30     ` Joseph S. Myers
@ 2008-06-22 11:34       ` Ira Rosen
  2008-06-26  8:49         ` Ira Rosen
  0 siblings, 1 reply; 9+ messages in thread
From: Ira Rosen @ 2008-06-22 11:34 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gcc-patches, Andrew Pinski



gcc-patches-owner@gcc.gnu.org wrote on 22/06/2008 13:55:00:

> On Sun, 22 Jun 2008, Ira Rosen wrote:
>
> > Andrew Pinski <pinskia@gmail.com> wrote on 22/06/2008 12:12:44:
> >
> > > How about just skiping these tests on spu instead?  Since really this
> > > is not a really a xfail since the test is testing the wrong thing on
> > > spu.
> > >
> >
> > Right. Here is the patch.
>
> The correct way to skip them is to modify
> check_effective_target_vect_cmdline_needed in target-supports.exp to know

> that SPU does not need command-line options to vectorize, not to modify
> the individual tests.

Thanks. SPU should be added there anyway.

Thanks,
Ira

ChangeLog:

      * testsuite/lib/target-supports.exp
      (check_effective_target_vect_cmdline_needed): Add SPU to the list
      of targets that do not need command line argument to enable SIMD.

Index: testsuite/lib/target-supports.exp
===================================================================
--- testsuite/lib/target-supports.exp   (revision 136939)
+++ testsuite/lib/target-supports.exp   (working copy)
@@ -1116,7 +1116,8 @@ proc check_effective_target_vect_cmdline
                 && [check_effective_target_lp64])
             || ([istarget powerpc*-*-*]
                 && ([check_effective_target_powerpc_spe]
-                    || [check_effective_target_powerpc_altivec]))} {,
+                    || [check_effective_target_powerpc_altivec]))}
+             || [istarget spu-*-*]} {
           set et_vect_cmdline_needed_saved 0
        }
     }


>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch, testsuite] Fixed generic vectorization testcase for Cell  SPU
  2008-06-22 11:34       ` Ira Rosen
@ 2008-06-26  8:49         ` Ira Rosen
  0 siblings, 0 replies; 9+ messages in thread
From: Ira Rosen @ 2008-06-26  8:49 UTC (permalink / raw)
  To: Ira Rosen; +Cc: gcc-patches, Joseph S. Myers, Andrew Pinski

> ChangeLog:
>
>       * testsuite/lib/target-supports.exp
>       (check_effective_target_vect_cmdline_needed): Add SPU to the list
>       of targets that do not need command line argument to enable SIMD.
>
> Index: testsuite/lib/target-supports.exp
> ===================================================================
> --- testsuite/lib/target-supports.exp   (revision 136939)
> +++ testsuite/lib/target-supports.exp   (working copy)
> @@ -1116,7 +1116,8 @@ proc check_effective_target_vect_cmdline
>                  && [check_effective_target_lp64])
>              || ([istarget powerpc*-*-*]
>                  && ([check_effective_target_powerpc_spe]
> -                    || [check_effective_target_powerpc_altivec]))} {,
> +                    || [check_effective_target_powerpc_altivec]))}
> +             || [istarget spu-*-*]} {
>            set et_vect_cmdline_needed_saved 0
>         }
>      }
>

Committed revision 137142 (trunk) and 137143 (4.3.2).

Ira

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch, testsuite] Fixed generic vectorization testcase for Cell  SPU
  2008-06-22 16:24 ` Andrew Pinski
@ 2008-06-22 16:34   ` Andy H
  0 siblings, 0 replies; 9+ messages in thread
From: Andy H @ 2008-06-22 16:34 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc-patches, joseph


what does word size have to be bigger than?

regards

Andy

Andrew Pinski wrote:
> On Sun, Jun 22, 2008 at 9:19 AM, Andy H <hutchinsonandy@aim.com> wrote:
>   
>> I have same problem due to completely opposite reason.
>>
>> http://gcc.gnu.org/ml/gcc/2008-06/msg00541.html
>>
>> Should I use same?
>>     
>
> No, those should vectorize even if you don't have vector modes (SPU is
> special in that it only have vector registers) if the register size is
> at least 32bits.  Most likely the reason why it is not being
> vectorized under avr is because the word size is too small so really
> they should be another check for that case.
>
> Thanks,
> Andrew Pinski
>   

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch, testsuite] Fixed generic vectorization testcase for Cell SPU
  2008-06-22 16:20 Andy H
@ 2008-06-22 16:24 ` Andrew Pinski
  2008-06-22 16:34   ` Andy H
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Pinski @ 2008-06-22 16:24 UTC (permalink / raw)
  To: Andy H; +Cc: gcc-patches, joseph

On Sun, Jun 22, 2008 at 9:19 AM, Andy H <hutchinsonandy@aim.com> wrote:
> I have same problem due to completely opposite reason.
>
> http://gcc.gnu.org/ml/gcc/2008-06/msg00541.html
>
> Should I use same?

No, those should vectorize even if you don't have vector modes (SPU is
special in that it only have vector registers) if the register size is
at least 32bits.  Most likely the reason why it is not being
vectorized under avr is because the word size is too small so really
they should be another check for that case.

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch, testsuite] Fixed generic vectorization testcase for Cell  SPU
@ 2008-06-22 16:20 Andy H
  2008-06-22 16:24 ` Andrew Pinski
  0 siblings, 1 reply; 9+ messages in thread
From: Andy H @ 2008-06-22 16:20 UTC (permalink / raw)
  To: gcc-patches, joseph

I have same problem due to completely opposite reason.

http://gcc.gnu.org/ml/gcc/2008-06/msg00541.html

Should I use same?


Andy



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-06-26  6:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-22  9:13 [patch, testsuite] Fixed generic vectorization testcase for Cell SPU Ira Rosen
2008-06-22  9:48 ` Andrew Pinski
2008-06-22 10:37   ` Ira Rosen
2008-06-22 11:30     ` Joseph S. Myers
2008-06-22 11:34       ` Ira Rosen
2008-06-26  8:49         ` Ira Rosen
2008-06-22 16:20 Andy H
2008-06-22 16:24 ` Andrew Pinski
2008-06-22 16:34   ` Andy H

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).