1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s
4 define i32 @testmsws(float %x) {
5 ; CHECK-LABEL: testmsws:
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: pushq %rax
8 ; CHECK-NEXT: .cfi_def_cfa_offset 16
9 ; CHECK-NEXT: callq llroundf
10 ; CHECK-NEXT: # kill: def $eax killed $eax killed $rax
11 ; CHECK-NEXT: popq %rcx
12 ; CHECK-NEXT: .cfi_def_cfa_offset 8
15 %0 = tail call i64 @llvm.llround.f32(float %x)
16 %conv = trunc i64 %0 to i32
20 define i64 @testmsxs(float %x) {
21 ; CHECK-LABEL: testmsxs:
22 ; CHECK: # %bb.0: # %entry
23 ; CHECK-NEXT: jmp llroundf # TAILCALL
25 %0 = tail call i64 @llvm.llround.f32(float %x)
29 define i32 @testmswd(double %x) {
30 ; CHECK-LABEL: testmswd:
31 ; CHECK: # %bb.0: # %entry
32 ; CHECK-NEXT: pushq %rax
33 ; CHECK-NEXT: .cfi_def_cfa_offset 16
34 ; CHECK-NEXT: callq llround
35 ; CHECK-NEXT: # kill: def $eax killed $eax killed $rax
36 ; CHECK-NEXT: popq %rcx
37 ; CHECK-NEXT: .cfi_def_cfa_offset 8
40 %0 = tail call i64 @llvm.llround.f64(double %x)
41 %conv = trunc i64 %0 to i32
45 define i64 @testmsxd(double %x) {
46 ; CHECK-LABEL: testmsxd:
47 ; CHECK: # %bb.0: # %entry
48 ; CHECK-NEXT: jmp llround # TAILCALL
50 %0 = tail call i64 @llvm.llround.f64(double %x)
54 define i32 @testmswl(x86_fp80 %x) {
55 ; CHECK-LABEL: testmswl:
56 ; CHECK: # %bb.0: # %entry
57 ; CHECK-NEXT: subq $24, %rsp
58 ; CHECK-NEXT: .cfi_def_cfa_offset 32
59 ; CHECK-NEXT: fldt {{[0-9]+}}(%rsp)
60 ; CHECK-NEXT: fstpt (%rsp)
61 ; CHECK-NEXT: callq llroundl
62 ; CHECK-NEXT: # kill: def $eax killed $eax killed $rax
63 ; CHECK-NEXT: addq $24, %rsp
64 ; CHECK-NEXT: .cfi_def_cfa_offset 8
67 %0 = tail call i64 @llvm.llround.f80(x86_fp80 %x)
68 %conv = trunc i64 %0 to i32
72 define i64 @testmsll(x86_fp80 %x) {
73 ; CHECK-LABEL: testmsll:
74 ; CHECK: # %bb.0: # %entry
75 ; CHECK-NEXT: jmp llroundl # TAILCALL
77 %0 = tail call i64 @llvm.llround.f80(x86_fp80 %x)
81 declare i64 @llvm.llround.f32(float) nounwind readnone
82 declare i64 @llvm.llround.f64(double) nounwind readnone
83 declare i64 @llvm.llround.f80(x86_fp80) nounwind readnone