This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] vectorizer: fix handling of non VECTOR_MODE_P vectypes
- From: ja2morri at csclub dot uwaterloo dot ca (James A. Morrison)
- To: Dorit Naishlos <DORIT at il dot ibm dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org,mark at codesourcery dot com
- Date: 12 Oct 2004 16:39:22 -0400
- Subject: Re: [patch] vectorizer: fix handling of non VECTOR_MODE_P vectypes
- References: <OF87500414.80B5955B-ONC2256F2B.005DFECB-C2256F2B.00640DEC@il.ibm.com>
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