1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-require-effective-target powerpc_fprs } */
3 /* { dg-options "-O3 -ftree-vectorize -mrecip -ffast-math -mdejagnu-cpu=power7 -fno-unroll-loops" } */
4 /* { dg-final { scan-assembler-times "xvrsqrtedp" 1 } } */
5 /* { dg-final { scan-assembler-times "xvmuldp" 2 } } */
6 /* { dg-final { scan-assembler-times "xvnmsub.dp" 2 } } */
7 /* { dg-final { scan-assembler-times "xvmadd.dp" 3 } } */
8 /* { dg-final { scan-assembler-times "xvrsqrtesp" 1 } } */
9 /* { dg-final { scan-assembler-times "xvmulsp" 2 } } */
10 /* { dg-final { scan-assembler-times "xvnmsub.sp" 1 } } */
11 /* { dg-final { scan-assembler-times "xvmadd.sp" 1 } } */
15 extern double a_d
[SIZE
] __attribute__((__aligned__(32)));
16 extern double b_d
[SIZE
] __attribute__((__aligned__(32)));
19 vectorize_rsqrt_d (void)
23 for (i
= 0; i
< SIZE
; i
++)
24 a_d
[i
] = 1.0 / __builtin_sqrt (b_d
[i
]);
27 extern float a_f
[SIZE
] __attribute__((__aligned__(32)));
28 extern float b_f
[SIZE
] __attribute__((__aligned__(32)));
31 vectorize_rsqrt_f (void)
35 for (i
= 0; i
< SIZE
; i
++)
36 a_f
[i
] = 1.0f
/ __builtin_sqrtf (b_f
[i
]);