1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
5 /* { dg-options "-O2 -ftree-vectorize -mcpu=power7 -ffast-math" } */
6 /* { dg-final { scan-assembler "xvadddp" } } */
7 /* { dg-final { scan-assembler "xvsubdp" } } */
8 /* { dg-final { scan-assembler "xvmuldp" } } */
9 /* { dg-final { scan-assembler "xvdivdp" } } */
10 /* { dg-final { scan-assembler "xvmadd" } } */
11 /* { dg-final { scan-assembler "xvmsub" } } */
12 /* { dg-final { scan-assembler "xvsqrtdp" } } */
13 /* { dg-final { scan-assembler "xvcpsgndp" } } */
14 /* { dg-final { scan-assembler "xvrdpim" } } */
15 /* { dg-final { scan-assembler "xvrdpip" } } */
16 /* { dg-final { scan-assembler "xvrdpiz" } } */
17 /* { dg-final { scan-assembler "xvrdpic" } } */
18 /* { dg-final { scan-assembler "xvrdpi " } } */
24 double a
[SIZE
] __attribute__((__aligned__(32)));
25 double b
[SIZE
] __attribute__((__aligned__(32)));
26 double c
[SIZE
] __attribute__((__aligned__(32)));
27 double d
[SIZE
] __attribute__((__aligned__(32)));
28 double e
[SIZE
] __attribute__((__aligned__(32)));
35 for (i
= 0; i
< SIZE
; i
++)
40 vector_subtract (void)
44 for (i
= 0; i
< SIZE
; i
++)
49 vector_multiply (void)
53 for (i
= 0; i
< SIZE
; i
++)
58 vector_multiply_add (void)
62 for (i
= 0; i
< SIZE
; i
++)
63 a
[i
] = (b
[i
] * c
[i
]) + d
[i
];
67 vector_multiply_subtract (void)
71 for (i
= 0; i
< SIZE
; i
++)
72 a
[i
] = (b
[i
] * c
[i
]) - d
[i
];
80 for (i
= 0; i
< SIZE
; i
++)
84 extern double sqrt (double);
85 extern double floor (double);
86 extern double ceil (double);
87 extern double trunc (double);
88 extern double nearbyint (double);
89 extern double rint (double);
90 extern double copysign (double, double);
97 for (i
= 0; i
< SIZE
; i
++)
106 for (i
= 0; i
< SIZE
; i
++)
115 for (i
= 0; i
< SIZE
; i
++)
124 for (i
= 0; i
< SIZE
; i
++)
129 vector_nearbyint (void)
133 for (i
= 0; i
< SIZE
; i
++)
134 a
[i
] = nearbyint (b
[i
]);
142 for (i
= 0; i
< SIZE
; i
++)
147 vector_copysign (void)
151 for (i
= 0; i
< SIZE
; i
++)
152 a
[i
] = copysign (b
[i
], c
[i
]);