* cfghooks.c (verify_flow_info): Disable check that all probabilities
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / recip-5.c
blob664484ff48da73cc9d47fbd906a72cb72a9b52ef
1 /* { dg-do compile { target { powerpc*-*-* } } } */
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 "-O3 -ftree-vectorize -mrecip=all -ffast-math -mcpu=power7 -fno-unroll-loops" } */
6 /* { dg-final { scan-assembler-times "xvredp" 4 } } */
7 /* { dg-final { scan-assembler-times "xvresp" 5 } } */
8 /* { dg-final { scan-assembler-times "xsredp\|fre\ " 2 } } */
9 /* { dg-final { scan-assembler-times "fres\|xsresp" 2 } } */
10 /* { dg-final { scan-assembler-times "fmuls\|xsmulsp" 2 } } */
11 /* { dg-final { scan-assembler-times "fnmsubs\|xsnmsub.sp" 2 } } */
12 /* { dg-final { scan-assembler-times "xsmuldp\|fmul\ " 2 } } */
13 /* { dg-final { scan-assembler-times "xsnmsub.dp\|fnmsub\ " 4 } } */
14 /* { dg-final { scan-assembler-times "xvmulsp" 7 } } */
15 /* { dg-final { scan-assembler-times "xvnmsub.sp" 5 } } */
16 /* { dg-final { scan-assembler-times "xvmuldp" 6 } } */
17 /* { dg-final { scan-assembler-times "xvnmsub.dp" 8 } } */
19 #include <altivec.h>
21 float f_recip (float a, float b) { return __builtin_recipdivf (a, b); }
22 double d_recip (double a, double b) { return __builtin_recipdiv (a, b); }
24 float f_div (float a, float b) { return a / b; }
25 double d_div (double a, double b) { return a / b; }
27 #define SIZE 1024
29 double d_a[SIZE] __attribute__((__aligned__(32)));
30 double d_b[SIZE] __attribute__((__aligned__(32)));
31 double d_c[SIZE] __attribute__((__aligned__(32)));
33 float f_a[SIZE] __attribute__((__aligned__(32)));
34 float f_b[SIZE] __attribute__((__aligned__(32)));
35 float f_c[SIZE] __attribute__((__aligned__(32)));
37 void vec_f_recip (void)
39 int i;
41 for (i = 0; i < SIZE; i++)
42 f_a[i] = __builtin_recipdivf (f_b[i], f_c[i]);
45 void vec_d_recip (void)
47 int i;
49 for (i = 0; i < SIZE; i++)
50 d_a[i] = __builtin_recipdiv (d_b[i], d_c[i]);
53 void vec_f_div (void)
55 int i;
57 for (i = 0; i < SIZE; i++)
58 f_a[i] = f_b[i] / f_c[i];
61 void vec_f_div2 (void)
63 int i;
65 for (i = 0; i < SIZE; i++)
66 f_a[i] = f_b[i] / 2.0f;
69 void vec_f_div53 (void)
71 int i;
73 for (i = 0; i < SIZE; i++)
74 f_a[i] = f_b[i] / 53.0f;
77 void vec_d_div (void)
79 int i;
81 for (i = 0; i < SIZE; i++)
82 d_a[i] = d_b[i] / d_c[i];
85 void vec_d_div2 (void)
87 int i;
89 for (i = 0; i < SIZE; i++)
90 d_a[i] = d_b[i] / 2.0;
93 void vec_d_div53 (void)
95 int i;
97 for (i = 0; i < SIZE; i++)
98 d_a[i] = d_b[i] / 53.0;
101 vector float v4sf_recip1 (vector float a, vector float b) { return vec_recipdiv (a, b); }
102 vector float v4sf_recip2 (vector float a, vector float b) { return __builtin_altivec_vrecipdivfp (a, b); }
103 vector double v2df_recip1 (vector double a, vector double b) { return vec_recipdiv (a, b); }
104 vector float v4sf_recip3 (vector float a, vector float b) { return __builtin_vsx_xvrecipdivsp (a, b); }
105 vector double v2df_recip2 (vector double a, vector double b) { return __builtin_vsx_xvrecipdivdp (a, b); }