| 1 |
/* { dg-options "-O2 -ffast-math -fdump-tree-optimized" } */ |
| 2 |
/* { dg-additional-options "-msse -mfpmath=sse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
float f(float x) |
| 5 |
{ |
| 6 |
float t = __builtin_copysignf (1.0f, x); |
| 7 |
return x * t; |
| 8 |
} |
| 9 |
float f1(float x) |
| 10 |
{ |
| 11 |
float t = __builtin_copysignf (1.0f, -x); |
| 12 |
return x * t; |
| 13 |
} |
| 14 |
/* { dg-final { scan-tree-dump-times "ABS" 1 "optimized" { target ifn_copysign } } } */ |
| 15 |
/* { dg-final { scan-tree-dump-times ".COPYSIGN" 1 "optimized" { target ifn_copysign } } } */ |
| 16 |
/* { dg-final { scan-tree-dump-times "ABS" 2 "optimized" { target { ! ifn_copysign } } } } */ |