1 ; Make sure this testcase codegens to the fabs instruction, not a call to fabsf
2 ; RUN: llc < %s -march=x86 -mattr=-sse2,-sse3,-sse | FileCheck %s
3 ; RUN: llc < %s -march=x86 -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math -enable-no-nans-fp-math | FileCheck %s --check-prefix=UNSAFE
5 declare float @fabsf(float)
7 declare x86_fp80 @fabsl(x86_fp80)
11 define float @test1(float %X) {
12 %Y = call float @fabsf(float %X)
15 ; CHECK: {{^[ \t]+fabs$}}
16 ; UNSAFE: {{^[ \t]+fabs$}}
23 define double @test2(double %X) {
24 %Y = fcmp oge double %X, -0.0
25 %Z = fsub double -0.0, %X
26 %Q = select i1 %Y, double %X, double %Z
29 ; fabs is not used here.
32 ; UNSAFE: {{^[ \t]+fabs$}}
38 define x86_fp80 @test3(x86_fp80 %X) {
39 %Y = call x86_fp80 @fabsl(x86_fp80 %X)
42 ; CHECK: {{^[ \t]+fabs$}}
43 ; UNSAFE: {{^[ \t]+fabs$}}