1
1
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2
2
; RUN: llc < %s -mtriple=x86_64-linux-gnu | FileCheck %s --check-prefixes=X64,DAG-X64
3
3
; RUN: llc < %s -mtriple=x86_64-linux-gnu -fast-isel | FileCheck %s --check-prefixes=X64,FASTISEL-X64
4
- ; RUN: llc < %s -mtriple=i686-linux-gnu | FileCheck %s --check-prefixes=X86
5
- ; RUN: llc < %s -mtriple=i686-linux-gnu -fast-isel | FileCheck %s --check-prefixes=X86
4
+ ; RUN: llc < %s -mtriple=i686-linux-gnu | FileCheck %s --check-prefixes=X86,DAG-X86
5
+ ; RUN: llc < %s -mtriple=i686-linux-gnu -fast-isel | FileCheck %s --check-prefixes=X86,FASTISEL-X86
6
6
; RUN: llc < %s -mtriple=x86_64-linux-gnu -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=GISEL-X64
7
- ; RUN: llc < %s -mtriple=i686-linux-gnu -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=X86
7
+ ; RUN: llc < %s -mtriple=i686-linux-gnu -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=X86,GISEL-X86
8
8
9
9
define float @trunc_f32 (float %a ) nounwind readnone {
10
10
; DAG-X64-LABEL: trunc_f32:
@@ -18,12 +18,39 @@ define float @trunc_f32(float %a) nounwind readnone {
18
18
; FASTISEL-X64-NEXT: popq %rax
19
19
; FASTISEL-X64-NEXT: retq
20
20
;
21
+ ; DAG-X86-LABEL: trunc_f32:
22
+ ; DAG-X86: # %bb.0:
23
+ ; DAG-X86-NEXT: subl $12, %esp
24
+ ; DAG-X86-NEXT: flds {{[0-9]+}}(%esp)
25
+ ; DAG-X86-NEXT: fstps (%esp)
26
+ ; DAG-X86-NEXT: calll truncf
27
+ ; DAG-X86-NEXT: addl $12, %esp
28
+ ; DAG-X86-NEXT: retl
29
+ ;
30
+ ; FASTISEL-X86-LABEL: trunc_f32:
31
+ ; FASTISEL-X86: # %bb.0:
32
+ ; FASTISEL-X86-NEXT: subl $12, %esp
33
+ ; FASTISEL-X86-NEXT: flds {{[0-9]+}}(%esp)
34
+ ; FASTISEL-X86-NEXT: fstps (%esp)
35
+ ; FASTISEL-X86-NEXT: calll truncf
36
+ ; FASTISEL-X86-NEXT: addl $12, %esp
37
+ ; FASTISEL-X86-NEXT: retl
38
+ ;
21
39
; GISEL-X64-LABEL: trunc_f32:
22
40
; GISEL-X64: # %bb.0:
23
41
; GISEL-X64-NEXT: pushq %rax
24
42
; GISEL-X64-NEXT: callq truncf
25
43
; GISEL-X64-NEXT: popq %rax
26
44
; GISEL-X64-NEXT: retq
45
+ ;
46
+ ; GISEL-X86-LABEL: trunc_f32:
47
+ ; GISEL-X86: # %bb.0:
48
+ ; GISEL-X86-NEXT: subl $12, %esp
49
+ ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
50
+ ; GISEL-X86-NEXT: movl %eax, (%esp)
51
+ ; GISEL-X86-NEXT: calll truncf
52
+ ; GISEL-X86-NEXT: addl $12, %esp
53
+ ; GISEL-X86-NEXT: retl
27
54
%c = call float @llvm.trunc.f32 (float %a )
28
55
ret float %c
29
56
}
@@ -40,12 +67,44 @@ define double @trunc_f64(double %a) nounwind readnone {
40
67
; FASTISEL-X64-NEXT: popq %rax
41
68
; FASTISEL-X64-NEXT: retq
42
69
;
70
+ ; DAG-X86-LABEL: trunc_f64:
71
+ ; DAG-X86: # %bb.0:
72
+ ; DAG-X86-NEXT: subl $12, %esp
73
+ ; DAG-X86-NEXT: fldl {{[0-9]+}}(%esp)
74
+ ; DAG-X86-NEXT: fstpl (%esp)
75
+ ; DAG-X86-NEXT: calll trunc
76
+ ; DAG-X86-NEXT: addl $12, %esp
77
+ ; DAG-X86-NEXT: retl
78
+ ;
79
+ ; FASTISEL-X86-LABEL: trunc_f64:
80
+ ; FASTISEL-X86: # %bb.0:
81
+ ; FASTISEL-X86-NEXT: subl $12, %esp
82
+ ; FASTISEL-X86-NEXT: fldl {{[0-9]+}}(%esp)
83
+ ; FASTISEL-X86-NEXT: fstpl (%esp)
84
+ ; FASTISEL-X86-NEXT: calll trunc
85
+ ; FASTISEL-X86-NEXT: addl $12, %esp
86
+ ; FASTISEL-X86-NEXT: retl
87
+ ;
43
88
; GISEL-X64-LABEL: trunc_f64:
44
89
; GISEL-X64: # %bb.0:
45
90
; GISEL-X64-NEXT: pushq %rax
46
91
; GISEL-X64-NEXT: callq trunc
47
92
; GISEL-X64-NEXT: popq %rax
48
93
; GISEL-X64-NEXT: retq
94
+ ;
95
+ ; GISEL-X86-LABEL: trunc_f64:
96
+ ; GISEL-X86: # %bb.0:
97
+ ; GISEL-X86-NEXT: subl $12, %esp
98
+ ; GISEL-X86-NEXT: leal {{[0-9]+}}(%esp), %eax
99
+ ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
100
+ ; GISEL-X86-NEXT: movl 4(%eax), %eax
101
+ ; GISEL-X86-NEXT: xorl %edx, %edx
102
+ ; GISEL-X86-NEXT: addl %esp, %edx
103
+ ; GISEL-X86-NEXT: movl %ecx, (%esp)
104
+ ; GISEL-X86-NEXT: movl %eax, 4(%edx)
105
+ ; GISEL-X86-NEXT: calll trunc
106
+ ; GISEL-X86-NEXT: addl $12, %esp
107
+ ; GISEL-X86-NEXT: retl
49
108
%c = call double @llvm.trunc.f64 (double %a )
50
109
ret double %c
51
110
}
@@ -80,4 +139,3 @@ define x86_fp80 @trunc_f80(x86_fp80 %a) nounwind readnone {
80
139
%c = call x86_fp80 @llvm.trunc.f80 (x86_fp80 %a )
81
140
ret x86_fp80 %c
82
141
}
83
-
0 commit comments