aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/pr47251.c
blob: 3089c493378073354a68f492ec5634caf029f1c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile { target { powerpc*-*-* && ip32 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -msoft-float -mcpu=power7" } */

/* PR 47151: libgcc fails to build when using --with-cpu=power7 due to a missed
   TARGET_HARD_FLOAT test.  */
unsigned int
__fixunssfdi (float a)
{
  const float dfa = a;
  const unsigned int hi = dfa / 0x1p32f;
  const unsigned int lo = dfa - (float) hi * 0x1p32f;
  return ((unsigned int) hi << (4 * 8)) | lo;
}