| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2" } */ |
| 3 |
|
| 4 |
typedef int SItype __attribute__ ((mode (SI))); |
| 5 |
typedef unsigned int USItype __attribute__ ((mode (SI))); |
| 6 |
typedef unsigned int UDItype __attribute__ ((mode (DI))); |
| 7 |
typedef UDItype __attribute__ ((__may_alias__)) bar_t; |
| 8 |
|
| 9 |
static inline __attribute__((__always_inline__)) SItype |
| 10 |
bar (const bar_t **p, SItype prec) |
| 11 |
{ |
| 12 |
bar_t mslimb = 0; |
| 13 |
SItype i = 20; |
| 14 |
SItype n = ((USItype) prec) % 4; |
| 15 |
if (n) |
| 16 |
{ |
| 17 |
prec -= n; |
| 18 |
if (prec == 0) |
| 19 |
return 1; |
| 20 |
mslimb = (*p)[i]; |
| 21 |
} |
| 22 |
while (mslimb == 0) |
| 23 |
{ |
| 24 |
prec -= 4; |
| 25 |
if (prec == 0) |
| 26 |
return 1; |
| 27 |
--i; |
| 28 |
mslimb = (*p)[i]; |
| 29 |
} |
| 30 |
return prec; |
| 31 |
} |
| 32 |
UDItype |
| 33 |
foo (const bar_t *i, SItype iprec) |
| 34 |
{ |
| 35 |
iprec = bar (&i, iprec); |
| 36 |
USItype aiprec = iprec < 0 ? -iprec : iprec; |
| 37 |
bar_t msb = *i; |
| 38 |
UDItype mantissa = 0; |
| 39 |
if (aiprec % 4) |
| 40 |
msb &= ((bar_t) 1 << aiprec) - 1; |
| 41 |
if (aiprec >= 54) |
| 42 |
mantissa = (UDItype) msb << 32; |
| 43 |
|
| 44 |
return (mantissa ^ (UDItype) 0x20000000000000); |
| 45 |
} |