1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s
; RUN: llc < %s -mtriple=i686-unknown -mattr=sse2 | FileCheck %s
; RUN: llc < %s -mtriple=i686-linux-gnu -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=GISEL-X86
; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=X64
; RUN: llc < %s -mtriple=x86_64-linux-gnu -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=GISEL-X64
define i32 @testmsws(float %x) nounwind {
; CHECK-LABEL: testmsws:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: jmp lroundf # TAILCALL
;
; GISEL-X86-LABEL: testmsws:
; GISEL-X86: # %bb.0: # %entry
; GISEL-X86-NEXT: subl $12, %esp
; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; GISEL-X86-NEXT: movl %eax, (%esp)
; GISEL-X86-NEXT: calll lroundf
; GISEL-X86-NEXT: addl $12, %esp
; GISEL-X86-NEXT: retl
;
; X64-LABEL: testmsws:
; X64: # %bb.0: # %entry
; X64-NEXT: jmp lroundf@PLT # TAILCALL
;
; GISEL-X64-LABEL: testmsws:
; GISEL-X64: # %bb.0: # %entry
; GISEL-X64-NEXT: pushq %rax
; GISEL-X64-NEXT: callq lroundf
; GISEL-X64-NEXT: popq %rcx
; GISEL-X64-NEXT: retq
entry:
%0 = tail call i32 @llvm.lround.i32.f32(float %x)
ret i32 %0
}
define i32 @testmswd(double %x) nounwind {
; CHECK-LABEL: testmswd:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: jmp lround # TAILCALL
;
; GISEL-X86-LABEL: testmswd:
; GISEL-X86: # %bb.0: # %entry
; GISEL-X86-NEXT: subl $12, %esp
; GISEL-X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; GISEL-X86-NEXT: movl 4(%eax), %eax
; GISEL-X86-NEXT: xorl %edx, %edx
; GISEL-X86-NEXT: addl %esp, %edx
; GISEL-X86-NEXT: movl %ecx, (%esp)
; GISEL-X86-NEXT: movl %eax, 4(%edx)
; GISEL-X86-NEXT: calll lround
; GISEL-X86-NEXT: addl $12, %esp
; GISEL-X86-NEXT: retl
;
; X64-LABEL: testmswd:
; X64: # %bb.0: # %entry
; X64-NEXT: jmp lround@PLT # TAILCALL
;
; GISEL-X64-LABEL: testmswd:
; GISEL-X64: # %bb.0: # %entry
; GISEL-X64-NEXT: pushq %rax
; GISEL-X64-NEXT: callq lround
; GISEL-X64-NEXT: popq %rcx
; GISEL-X64-NEXT: retq
entry:
%0 = tail call i32 @llvm.lround.i32.f64(double %x)
ret i32 %0
}
define i32 @testmsll(x86_fp80 %x) nounwind {
; CHECK-LABEL: testmsll:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: jmp lroundl # TAILCALL
;
; GISEL-X86-LABEL: testmsll:
; GISEL-X86: # %bb.0: # %entry
; GISEL-X86-NEXT: subl $12, %esp
; GISEL-X86-NEXT: fldt {{[0-9]+}}(%esp)
; GISEL-X86-NEXT: fstpt (%esp)
; GISEL-X86-NEXT: calll lroundl
; GISEL-X86-NEXT: addl $12, %esp
; GISEL-X86-NEXT: retl
;
; X64-LABEL: testmsll:
; X64: # %bb.0: # %entry
; X64-NEXT: jmp lroundl@PLT # TAILCALL
;
; GISEL-X64-LABEL: testmsll:
; GISEL-X64: # %bb.0: # %entry
; GISEL-X64-NEXT: subq $24, %rsp
; GISEL-X64-NEXT: fldt {{[0-9]+}}(%rsp)
; GISEL-X64-NEXT: fstpt (%rsp)
; GISEL-X64-NEXT: callq lroundl
; GISEL-X64-NEXT: addq $24, %rsp
; GISEL-X64-NEXT: retq
entry:
%0 = tail call i32 @llvm.lround.i32.f80(x86_fp80 %x)
ret i32 %0
}
|