Split the Add, Sub, and Mul instruction opcodes into separate
[oota-llvm.git] / test / CodeGen / X86 / fabs.ll
1 ; Make sure this testcase codegens to the fabs instruction, not a call to fabsf
2 ; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3,-sse | grep fabs\$ | \
3 ; RUN:   count 2
4 ; RUN: llvm-as < %s | \
5 ; RUN:   llc -march=x86 -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | \
6 ; RUN:   grep fabs\$ | count 3
7
8 declare float @fabsf(float)
9
10 declare x86_fp80 @fabsl(x86_fp80)
11
12 define float @test1(float %X) {
13         %Y = call float @fabsf(float %X)
14         ret float %Y
15 }
16
17 define double @test2(double %X) {
18         %Y = fcmp oge double %X, -0.0
19         %Z = fsub double -0.0, %X
20         %Q = select i1 %Y, double %X, double %Z
21         ret double %Q
22 }
23
24 define x86_fp80 @test3(x86_fp80 %X) {
25         %Y = call x86_fp80 @fabsl(x86_fp80 %X)
26         ret x86_fp80 %Y
27 }
28
29