1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=-sse,-sse2,-sse3 | FileCheck %s --check-prefix=X87
3 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math -enable-no-nans-fp-math | FileCheck %s --check-prefix=X87UNSAFE
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64
6 declare float @fabsf(float)
7 declare x86_fp80 @fabsl(x86_fp80)
9 define float @test1(float %X) {
12 ; X87-NEXT: flds {{[0-9]+}}(%esp)
16 ; X87UNSAFE-LABEL: test1:
18 ; X87UNSAFE-NEXT: flds {{[0-9]+}}(%esp)
19 ; X87UNSAFE-NEXT: fabs
20 ; X87UNSAFE-NEXT: retl
24 ; X64-NEXT: andps {{.*}}(%rip), %xmm0
26 %Y = call float @fabsf(float %X) readnone
30 define x86_fp80 @test2(x86_fp80 %X) {
33 ; X87-NEXT: fldt {{[0-9]+}}(%esp)
37 ; X87UNSAFE-LABEL: test2:
39 ; X87UNSAFE-NEXT: fldt {{[0-9]+}}(%esp)
40 ; X87UNSAFE-NEXT: fabs
41 ; X87UNSAFE-NEXT: retl
45 ; X64-NEXT: fldt {{[0-9]+}}(%rsp)
48 %Y = call x86_fp80 @fabsl(x86_fp80 %X) readnone