1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-options "-O3 -ftree-vectorize -mrecip -ffast-math -mcpu=power7 -fno-unroll-loops" } */
3 /* { dg-final { scan-assembler-times "xvrsqrtedp" 1 } } */
4 /* { dg-final { scan-assembler-times "xvmsub.dp" 1 } } */
5 /* { dg-final { scan-assembler-times "xvmuldp" 4 } } */
6 /* { dg-final { scan-assembler-times "xvnmsub.dp" 2 } } */
7 /* { dg-final { scan-assembler-times "xvrsqrtesp" 1 } } */
8 /* { dg-final { scan-assembler-times "xvmsub.sp" 1 } } */
9 /* { dg-final { scan-assembler-times "xvmulsp" 4 } } */
10 /* { dg-final { scan-assembler-times "xvnmsub.sp" 2 } } */
14 extern double a_d[SIZE] __attribute__((__aligned__(32)));
15 extern double b_d[SIZE] __attribute__((__aligned__(32)));
18 vectorize_rsqrt_d (void)
22 for (i = 0; i < SIZE; i++)
23 a_d[i] = 1.0 / __builtin_sqrt (b_d[i]);
26 extern float a_f[SIZE] __attribute__((__aligned__(32)));
27 extern float b_f[SIZE] __attribute__((__aligned__(32)));
30 vectorize_rsqrt_f (void)
34 for (i = 0; i < SIZE; i++)
35 a_f[i] = 1.0f / __builtin_sqrtf (b_f[i]);