PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr44423.c
blob1c6fe9f6a5825962bcc659d088e9c790ee6afc7f
1 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-msse -O2 -fdump-tree-esra-details" } */
4 #include "xmmintrin.h"
6 typedef __m128 v4sf; // vector of 4 floats (SSE1)
8 #define ARRSZ 1024
10 typedef union {
11 float f[4];
12 v4sf v;
13 } V4SF;
15 struct COLOUR {
16 float r,g,b;
19 void func (float *pre1, float pre2, struct COLOUR *a, V4SF *lpic)
21 V4SF va;
22 int y;
23 va.f[0]=a->r;va.f[1]=a->g;va.f[2]=a->b;va.f[3]=0.f;
24 for (y=0; y<20; ++y)
26 float att = pre1[y]*pre2;
27 v4sf tmpatt=_mm_load1_ps(&att);
28 tmpatt=_mm_mul_ps(tmpatt,va.v);
29 lpic[y].v=_mm_add_ps(tmpatt,lpic[y].v);
33 int main()
35 V4SF lpic[ARRSZ];
36 float pre1[ARRSZ];
37 int i;
38 struct COLOUR col={0.,2.,4.};
39 for (i=0; i<20; ++i)
40 pre1[i]=0.4;
41 for (i=0;i<10000000;++i)
42 func(&pre1[0],0.3,&col,&lpic[0]);
43 return 0;
46 /* { dg-final { scan-tree-dump-times "Created a replacement" 0 "esra"} } */