Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / recip-4.c
blob54002d3c7a02eb8be0221b216f45e844875caa9e
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-require-effective-target powerpc_fprs } */
3 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
4 /* { dg-options "-O3 -ftree-vectorize -mrecip -ffast-math -mcpu=power7 -fno-unroll-loops" } */
5 /* { dg-final { scan-assembler-times "xvrsqrtedp" 1 } } */
6 /* { dg-final { scan-assembler-times "xvmuldp" 2 } } */
7 /* { dg-final { scan-assembler-times "xvnmsub.dp" 2 } } */
8 /* { dg-final { scan-assembler-times "xvmadd.dp" 3 } } */
9 /* { dg-final { scan-assembler-times "xvrsqrtesp" 1 } } */
10 /* { dg-final { scan-assembler-times "xvmulsp" 2 } } */
11 /* { dg-final { scan-assembler-times "xvnmsub.sp" 1 } } */
12 /* { dg-final { scan-assembler-times "xvmadd.sp" 1 } } */
14 #define SIZE 1024
16 extern double a_d[SIZE] __attribute__((__aligned__(32)));
17 extern double b_d[SIZE] __attribute__((__aligned__(32)));
19 void
20 vectorize_rsqrt_d (void)
22 int i;
24 for (i = 0; i < SIZE; i++)
25 a_d[i] = 1.0 / __builtin_sqrt (b_d[i]);
28 extern float a_f[SIZE] __attribute__((__aligned__(32)));
29 extern float b_f[SIZE] __attribute__((__aligned__(32)));
31 void
32 vectorize_rsqrt_f (void)
34 int i;
36 for (i = 0; i < SIZE; i++)
37 a_f[i] = 1.0f / __builtin_sqrtf (b_f[i]);