2016-12-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gcc.target / sparc / 20111102-1.c
blobd33f103e377cf7483de02db9ec1aaca459b3021d
1 /* PR target/50945 */
2 /* { dg-do compile } */
3 /* { dg-options "-O -msoft-float" } */
5 double
6 __powidf2 (double x, int m)
8 unsigned int n = m < 0 ? -m : m;
9 double y = n % 2 ? x : 1;
10 while (n >>= 1)
12 x = x * x;
13 if (n % 2)
14 y = y * x;
16 return m < 0 ? 1/y : y;