aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sparc/20111102-1.c
blob: d33f103e377cf7483de02db9ec1aaca459b3021d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* PR target/50945 */
/* { dg-do compile } */
/* { dg-options "-O -msoft-float" } */

double
__powidf2 (double x, int m)
{
  unsigned int n = m < 0 ? -m : m;
  double y = n % 2 ? x : 1;
  while (n >>= 1)
    {
      x = x * x;
      if (n % 2)
	y = y * x;
    }
  return m < 0 ? 1/y : y;
}