1 /* { dg-do run { target { powerpc*-*-* && vmx_hw } } }} */
2 /* { dg-options "-O2 -funroll-loops -ffast-math -fvariable-expansion-in-unroller -maltivec -fdump-rtl-loop2_unroll" } */
5 extern void abort (void);
6 extern void exit (int);
10 float in1
[N
] __attribute__ ((__aligned__ (16))) = {0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57};
11 float in2
[N
] __attribute__ ((__aligned__ (16))) = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
17 vector
float vp1
, vp2
, vp3
, vaccum
, vzero
, vtmp
;
20 vzero
= (vector
float){0, 0, 0, 0};
24 for (i
= 0; i
< n
; i
++)
26 vp1
= vec_ld (i
* 16, in1
);
27 vp2
= vec_ld (i
* 16, in2
);
29 vaccum
= vec_madd (vp1
, vp2
, vaccum
);
32 vtmp
= vec_sld (vaccum
, vaccum
, 8);
33 vp1
= vec_add (vaccum
, vtmp
);
34 vtmp
= vec_sld (vp1
, vp1
, 4);
35 vp2
= vec_add (vp1
, vtmp
);
37 vec_ste (vp2
, 0, &accum
);
53 /* { dg-final { scan-rtl-dump "Expanding Accumulator" "loop2_unroll" } } */
54 /* { dg-final { cleanup-rtl-dump "loop*" } } */