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: [patch] vectorizer: fix handling of non VECTOR_MODE_P vectypes


Dorit Naishlos <DORIT@il.ibm.com> writes:

> > Test case?
> 
> Sure:
> 
> Tests vect-[82,83].c below currently ICE.
> If compiled in addition with -mpowerpc64 (testcases vect-[82,83]_64.c),
> then they don't ICE: vect-82_64.c passes ok, and vect-83_64.c produces
> wrong results.
> With the patch (that disables vectorization in this case), the tests will
> pass, but we lose the opportunity to vectorize vect-82_64.c (which may not
> be so terrible cause we may want to convert this loop to a call to memset
> instead).
> 
> dorit
> 
> =====================================
> vect-82.c:
> /* { dg-do run { target powerpc*-*-* } } */
> /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" {
> target powerpc*-*-* } } */

 This doesn't look right.  Why do you need -mpowerpc64?  Or even 
-fdump-tree-vect-stats if this a runtime test?
 


> #include <stdarg.h>
> #include "tree-vect.h"
> 
> #define N 16
> 
> int main1 ()
> {
>   long long unsigned int ca[N];
>   int i;
> 
>   for (i = 0; i < N; i++)
>     ca[i] = 0;
> 
>   /* check results:  */
>   for (i = 0; i < N; i++)
>     {
>       if (ca[i] != 0)
>         abort ();
>     }
> 
>   return 0;
> }
> 
> int main (void)
> {
>   check_vect ();
>   return main1 ();
> }
> =====================================
> vect-83.c:
> /* { dg-do run { target powerpc*-*-* } } */
> /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" {
> target powerpc*-*-* } } */
> 
> #include <stdarg.h>
> #include "tree-vect.h"
> 
> #define N 16
> 
> int main1 ()
> {
>   long long unsigned int ca[N];
>   int i;
> 
>   for (i = 0; i < N; i++)
>     ca[i] = 2;
> 
>   /* check results:  */
>   for (i = 0; i < N; i++)
>     {
>       if (ca[i] != 2)
>         abort ();
>     }
> 
>   return 0;
> }
> 
> int main (void)
> {
>   check_vect ();
>   return main1 ();
> }
> =====================================
> vect-82_64.c:
> /* { dg-do run { target powerpc*-*-* } } */
> /* { dg-options "-O2 -ftree-vectorize -mpowerpc64 -fdump-tree-vect-stats
> -maltivec" { target powerpc*-*-* } } */
> 
> #include <stdarg.h>
> #include "tree-vect.h"
> 
> #define N 16
> 
> int main1 ()
> {
>   long long unsigned int ca[N];
>   int i;
> 
>   for (i = 0; i < N; i++)
>     ca[i] = 0;
> 
>   /* check results:  */
>   for (i = 0; i < N; i++)
>     {
>       if (ca[i] != 0)
>         abort ();
>     }
> 
>   return 0;
> }
> 
> int main (void)
> {
>   check_vect ();
>   return main1 ();
> }
> =====================================
> vect-83_64.c:
> /* { dg-do run { target powerpc*-*-* } } */
> /* { dg-options "-O2 -ftree-vectorize -mpowerpc64 -fdump-tree-vect-stats
> -maltivec" { target powerpc*-*-* } } */

> #include <stdarg.h>
> #include "tree-vect.h"
> 
> #define N 16
> 
> int main1 ()
> {
>   long long unsigned int ca[N];
>   int i;
> 
>   for (i = 0; i < N; i++)
>     ca[i] = 2;
> 
>   /* check results:  */
>   for (i = 0; i < N; i++)
>     {
>       if (ca[i] != 2)
>         abort ();
>     }
> 
>   return 0;
> }
> 
> int main (void)
> {
>   check_vect ();
>   return main1 ();
> }


-- 
Thanks,
Jim

http://www.student.cs.uwaterloo.ca/~ja2morri/
http://phython.blogspot.com
http://open.nit.ca/wiki/?page=jim


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