Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | ; Make sure this testcase codegens to the fabs instruction, not a call to fabsf |
Dale Johannesen | 7838838 | 2007-09-23 14:58:14 +0000 | [diff] [blame] | 2 | ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=-sse2,-sse3,-sse | \ |
Dan Gohman | 8c89a50 | 2007-08-15 13:36:28 +0000 | [diff] [blame] | 3 | ; RUN: grep fabs\$ | count 1 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 4 | ; RUN: llvm-upgrade < %s | llvm-as | \ |
Dale Johannesen | 7838838 | 2007-09-23 14:58:14 +0000 | [diff] [blame] | 5 | ; RUN: llc -march=x86 -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | \ |
Dan Gohman | 8c89a50 | 2007-08-15 13:36:28 +0000 | [diff] [blame] | 6 | ; RUN: grep fabs\$ | count 2 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 7 | |
| 8 | target endian = little |
| 9 | target pointersize = 32 |
| 10 | |
| 11 | declare float %fabsf(float) |
| 12 | |
| 13 | float %test1(float %X) { |
| 14 | %Y = call float %fabsf(float %X) |
| 15 | ret float %Y |
| 16 | } |
| 17 | |
| 18 | double %test2(double %X) { |
| 19 | %Y = setge double %X, -0.0 |
| 20 | %Z = sub double -0.0, %X |
| 21 | %Q = select bool %Y, double %X, double %Z |
| 22 | ret double %Q |
| 23 | } |
| 24 | |