]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/vect/vect-43.c
tree.def (ALIGN_INDIRECT_REF, [...]): New tree-codes.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / vect / vect-43.c
CommitLineData
79fe1b3b
DN
1/* { dg-do run { target powerpc*-*-* } } */
2/* { dg-do run { target i?86-*-* x86_64-*-* } } */
3/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
7ccf35ed 4/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse2" { target i?86-*-* x86_64-*-* } } */
79fe1b3b
DN
5
6#include <stdarg.h>
7#include "tree-vect.h"
8
9#define N 256
10
11typedef float afloat __attribute__ ((__aligned__(16)));
12
13void bar (afloat *pa, afloat *pb, afloat *pc)
14{
15 int i;
16
17 /* check results: */
18 for (i = 0; i < N; i++)
19 {
20 if (pa[i] != (pb[i] * pc[i]))
21 abort ();
22 }
23
24 return;
25}
26
27
28int
29main1 (afloat * pa)
30{
31 int i;
32 afloat pb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
33 afloat pc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
34
35
36 for (i = 0; i < N; i++)
37 {
38 pa[i] = pb[i] * pc[i];
39 }
40
41 bar (pa,pb,pc);
42
43 return 0;
44}
45
46int 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 return 0;
57}
58
59/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */