Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr48053-3.c
bloba45357019b6d3e8b3673f8f2692d7729bd75fbce
1 /* { dg-do compile } */
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 -mcpu=power7" } */
7 /* Cut down example from s_scalbnl that aborted on 32-bit when the fix for
8 48053 went in to allow creating DImode 0's in VSX registers. */
10 typedef union
12 long double value;
13 struct
15 unsigned long long msw;
16 unsigned long long lsw;
17 } parts64;
18 struct
20 unsigned int w0, w1, w2, w3;
21 } parts32;
22 } ieee854_long_double_shape_type;
24 static const long double twolm54 = 5.55111512312578270212e-17;
26 long double foo (long double x, int n)
28 long long k, hx, lx;
29 ieee854_long_double_shape_type qw_u;
31 qw_u.value = x;
32 hx = qw_u.parts64.msw;
33 lx = qw_u.parts64.lsw;
35 k = ((hx >> 52) & 0x7ff) + n + 54;
37 qw_u.parts64.msw = ((hx & 0x800fffffffffffffULL) | (k << 52));
38 qw_u.parts64.lsw = lx;
39 x = qw_u.value;
41 return x*twolm54;