1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s
3 ; RUN: llc < %s -mtriple=i686-unknown -mattr=sse2 | FileCheck %s --check-prefix=SSE2
5 define i64 @testmsxs_builtin(float %x) {
6 ; CHECK-LABEL: testmsxs_builtin:
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: pushl %eax
9 ; CHECK-NEXT: .cfi_def_cfa_offset 8
10 ; CHECK-NEXT: flds {{[0-9]+}}(%esp)
11 ; CHECK-NEXT: fstps (%esp)
12 ; CHECK-NEXT: calll llroundf
13 ; CHECK-NEXT: popl %ecx
14 ; CHECK-NEXT: .cfi_def_cfa_offset 4
17 ; SSE2-LABEL: testmsxs_builtin:
18 ; SSE2: # %bb.0: # %entry
19 ; SSE2-NEXT: pushl %eax
20 ; SSE2-NEXT: .cfi_def_cfa_offset 8
21 ; SSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
22 ; SSE2-NEXT: movss %xmm0, (%esp)
23 ; SSE2-NEXT: calll llroundf
24 ; SSE2-NEXT: popl %ecx
25 ; SSE2-NEXT: .cfi_def_cfa_offset 4
28 %0 = tail call i64 @llvm.llround.f32(float %x)
32 define i64 @testmsxd_builtin(double %x) {
33 ; CHECK-LABEL: testmsxd_builtin:
34 ; CHECK: # %bb.0: # %entry
35 ; CHECK-NEXT: subl $8, %esp
36 ; CHECK-NEXT: .cfi_def_cfa_offset 12
37 ; CHECK-NEXT: fldl {{[0-9]+}}(%esp)
38 ; CHECK-NEXT: fstpl (%esp)
39 ; CHECK-NEXT: calll llround
40 ; CHECK-NEXT: addl $8, %esp
41 ; CHECK-NEXT: .cfi_def_cfa_offset 4
44 ; SSE2-LABEL: testmsxd_builtin:
45 ; SSE2: # %bb.0: # %entry
46 ; SSE2-NEXT: subl $8, %esp
47 ; SSE2-NEXT: .cfi_def_cfa_offset 12
48 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
49 ; SSE2-NEXT: movsd %xmm0, (%esp)
50 ; SSE2-NEXT: calll llround
51 ; SSE2-NEXT: addl $8, %esp
52 ; SSE2-NEXT: .cfi_def_cfa_offset 4
55 %0 = tail call i64 @llvm.llround.f64(double %x)
59 declare i64 @llvm.llround.f32(float) nounwind readnone
60 declare i64 @llvm.llround.f64(double) nounwind readnone