gcc/testsuite/gcc.target/sparc/20111102-1.c
raw| 1 | /* PR target/50945 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-O -msoft-float" } */ |
| 4 | |
| 5 | double |
| 6 | __powidf2 (double x, int m) |
| 7 | { |
| 8 | unsigned int n = m < 0 ? -m : m; |
| 9 | double y = n % 2 ? x : 1; |
| 10 | while (n >>= 1) |
| 11 | { |
| 12 | x = x * x; |
| 13 | if (n % 2) |
| 14 | y = y * x; |
| 15 | } |
| 16 | return m < 0 ? 1/y : y; |
| 17 | } |