1 /* { dg-do compile } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-options "-O2 -ftree-vectorize -mdejagnu-cpu=power7 -ffast-math" } */
5 /* { dg-final { scan-assembler "xvadddp" } } */
6 /* { dg-final { scan-assembler "xvsubdp" } } */
7 /* { dg-final { scan-assembler "xvmuldp" } } */
8 /* { dg-final { scan-assembler "xvdivdp" } } */
9 /* { dg-final { scan-assembler "xvmadd" } } */
10 /* { dg-final { scan-assembler "xvmsub" } } */
11 /* { dg-final { scan-assembler "xvsqrtdp" } } */
12 /* { dg-final { scan-assembler "xvcpsgndp" } } */
13 /* { dg-final { scan-assembler "xvrdpim" } } */
14 /* { dg-final { scan-assembler "xvrdpip" } } */
15 /* { dg-final { scan-assembler "xvrdpiz" } } */
16 /* { dg-final { scan-assembler "xvrdpic" } } */
17 /* { dg-final { scan-assembler "xvrdpi " } } */
23 double a
[SIZE
] __attribute__((__aligned__(32)));
24 double b
[SIZE
] __attribute__((__aligned__(32)));
25 double c
[SIZE
] __attribute__((__aligned__(32)));
26 double d
[SIZE
] __attribute__((__aligned__(32)));
27 double e
[SIZE
] __attribute__((__aligned__(32)));
34 for (i
= 0; i
< SIZE
; i
++)
39 vector_subtract (void)
43 for (i
= 0; i
< SIZE
; i
++)
48 vector_multiply (void)
52 for (i
= 0; i
< SIZE
; i
++)
57 vector_multiply_add (void)
61 for (i
= 0; i
< SIZE
; i
++)
62 a
[i
] = (b
[i
] * c
[i
]) + d
[i
];
66 vector_multiply_subtract (void)
70 for (i
= 0; i
< SIZE
; i
++)
71 a
[i
] = (b
[i
] * c
[i
]) - d
[i
];
79 for (i
= 0; i
< SIZE
; i
++)
83 extern double sqrt (double);
84 extern double floor (double);
85 extern double ceil (double);
86 extern double trunc (double);
87 extern double nearbyint (double);
88 extern double rint (double);
89 extern double copysign (double, double);
96 for (i
= 0; i
< SIZE
; i
++)
105 for (i
= 0; i
< SIZE
; i
++)
114 for (i
= 0; i
< SIZE
; i
++)
123 for (i
= 0; i
< SIZE
; i
++)
128 vector_nearbyint (void)
132 for (i
= 0; i
< SIZE
; i
++)
133 a
[i
] = nearbyint (b
[i
]);
141 for (i
= 0; i
< SIZE
; i
++)
146 vector_copysign (void)
150 for (i
= 0; i
< SIZE
; i
++)
151 a
[i
] = copysign (b
[i
], c
[i
]);