Chris Lattner | 597f22f | 2005-04-02 05:35:00 +0000 | [diff] [blame] | 1 | ; Make sure this testcase codegens to the fabs instruction, not a call to fabsf |
Chris Lattner | c22158d | 2006-05-24 00:49:32 +0000 | [diff] [blame] | 2 | ; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3 | grep 'fabs$' | wc -l | grep 1 && |
| 3 | ; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3 -enable-unsafe-fp-math | grep 'fabs$' | wc -l | grep 2 |
Chris Lattner | 597f22f | 2005-04-02 05:35:00 +0000 | [diff] [blame] | 4 | |
Evan Cheng | bb0a23a | 2006-08-29 22:01:39 +0000 | [diff] [blame^] | 5 | target endian = little |
| 6 | target pointersize = 32 |
| 7 | |
Chris Lattner | 597f22f | 2005-04-02 05:35:00 +0000 | [diff] [blame] | 8 | declare float %fabsf(float) |
| 9 | |
| 10 | float %fabsftest(float %X) { |
| 11 | %Y = call float %fabsf(float %X) |
| 12 | ret float %Y |
| 13 | } |
| 14 | |
Chris Lattner | 2e6027c | 2005-04-09 04:55:14 +0000 | [diff] [blame] | 15 | double %fabstest2(double %X) { |
| 16 | %Y = setge double %X, -0.0 |
| 17 | %Z = sub double -0.0, %X |
| 18 | %Q = select bool %Y, double %X, double %Z |
| 19 | ret double %Q |
| 20 | } |
| 21 | |