pr16105.c: Enable for mipsisa64*-*-*.
[platform/upstream/gcc.git] / gcc / testsuite / gcc.dg / vect / vect-42.c
1 /* { dg-do run { target powerpc*-*-* } } */
2 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
3 /* { dg-do run { target mipsisa64*-*-* } } */
4 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
5 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse2" { target i?86-*-* x86_64-*-* } } */
6 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -mpaired-single" { target mipsisa64*-*-* } } */
7   
8 #include <stdarg.h>
9 #include "tree-vect.h"
10
11 #define N 256
12
13 typedef float afloat __attribute__ ((__aligned__(16)));
14
15 void bar (afloat *pa, afloat *pb, afloat *pc) 
16 {
17   int i;
18
19   /* check results:  */
20   for (i = 0; i < N; i++)
21     {
22       if (pa[i] != (pb[i] * pc[i]))
23         abort ();
24     }
25
26   return;
27 }
28
29
30 int
31 main1 (afloat * __restrict__ pa)
32 {
33   int i;
34   afloat pb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
35   afloat pc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
36
37
38   for (i = 0; i < N; i++)
39     {
40       pa[i] = pb[i] * pc[i];
41     }
42
43   return 0;
44 }
45
46 int main (void)
47 {
48   int i;
49   afloat a[N];
50   afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
51   afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
52
53   check_vect ();
54
55   main1 (a);
56   bar (a,b,c);
57   return 0;
58 }
59
60 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"} } */