• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -O0 -mtriple=x86_64-linux-gnu -global-isel -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
3
4--- |
5  ; ModuleID = 'sitofp.ll'
6  source_filename = "sitofp.c"
7  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8  target triple = "x86_64-unknown-linux-gnu"
9
10  ; Function Attrs: norecurse nounwind readnone uwtable
11  define dso_local float @int8_to_float(i8 signext %a) local_unnamed_addr #0 {
12  entry:
13    %conv = sitofp i8 %a to float
14    ret float %conv
15  }
16
17  ; Function Attrs: norecurse nounwind readnone uwtable
18  define dso_local float @int16_to_float(i16 signext %a) local_unnamed_addr #0 {
19  entry:
20    %conv = sitofp i16 %a to float
21    ret float %conv
22  }
23
24  ; Function Attrs: norecurse nounwind readnone uwtable
25  define dso_local float @int32_to_float(i32 %a) local_unnamed_addr #0 {
26  entry:
27    %conv = sitofp i32 %a to float
28    ret float %conv
29  }
30
31  ; Function Attrs: norecurse nounwind readnone uwtable
32  define dso_local float @int64_to_float(i64 %a) local_unnamed_addr #0 {
33  entry:
34    %conv = sitofp i64 %a to float
35    ret float %conv
36  }
37
38  ; Function Attrs: norecurse nounwind readnone uwtable
39  define dso_local double @int8_to_double(i8 signext %a) local_unnamed_addr #0 {
40  entry:
41    %conv = sitofp i8 %a to double
42    ret double %conv
43  }
44
45  ; Function Attrs: norecurse nounwind readnone uwtable
46  define dso_local double @int16_to_double(i16 signext %a) local_unnamed_addr #0 {
47  entry:
48    %conv = sitofp i16 %a to double
49    ret double %conv
50  }
51
52  ; Function Attrs: norecurse nounwind readnone uwtable
53  define dso_local double @int32_to_double(i32 %a) local_unnamed_addr #0 {
54  entry:
55    %conv = sitofp i32 %a to double
56    ret double %conv
57  }
58
59  ; Function Attrs: norecurse nounwind readnone uwtable
60  define dso_local double @int64_to_double(i64 %a) local_unnamed_addr #0 {
61  entry:
62    %conv = sitofp i64 %a to double
63    ret double %conv
64  }
65
66  attributes #0 = { norecurse nounwind readnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
67
68  !llvm.module.flags = !{!0}
69  !llvm.ident = !{!1}
70
71  !0 = !{i32 1, !"wchar_size", i32 4}
72  !1 = !{!"clang version 7.0.0"}
73
74...
75---
76name:            int8_to_float
77alignment:       16
78tracksRegLiveness: true
79registers:
80  - { id: 0, class: _ }
81  - { id: 1, class: _ }
82  - { id: 2, class: _ }
83  - { id: 3, class: _ }
84body:             |
85  bb.1.entry:
86    liveins: $edi
87
88    ; CHECK-LABEL: name: int8_to_float
89    ; CHECK: liveins: $edi
90    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
91    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
92    ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 24
93    ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s8)
94    ; CHECK: [[COPY2:%[0-9]+]]:_(s8) = COPY [[C]](s8)
95    ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[COPY2]](s8)
96    ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s32)
97    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s32)
98    ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
99    ; CHECK: RET 0, implicit $xmm0
100    %1:_(s32) = COPY $edi
101    %0:_(s8) = G_TRUNC %1(s32)
102    %2:_(s32) = G_SITOFP %0(s8)
103    %3:_(s128) = G_ANYEXT %2(s32)
104    $xmm0 = COPY %3(s128)
105    RET 0, implicit $xmm0
106
107...
108---
109name:            int16_to_float
110alignment:       16
111tracksRegLiveness: true
112registers:
113  - { id: 0, class: _ }
114  - { id: 1, class: _ }
115  - { id: 2, class: _ }
116  - { id: 3, class: _ }
117body:             |
118  bb.1.entry:
119    liveins: $edi
120
121    ; CHECK-LABEL: name: int16_to_float
122    ; CHECK: liveins: $edi
123    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
124    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
125    ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 16
126    ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s8)
127    ; CHECK: [[COPY2:%[0-9]+]]:_(s8) = COPY [[C]](s8)
128    ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[COPY2]](s8)
129    ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s32)
130    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s32)
131    ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
132    ; CHECK: RET 0, implicit $xmm0
133    %1:_(s32) = COPY $edi
134    %0:_(s16) = G_TRUNC %1(s32)
135    %2:_(s32) = G_SITOFP %0(s16)
136    %3:_(s128) = G_ANYEXT %2(s32)
137    $xmm0 = COPY %3(s128)
138    RET 0, implicit $xmm0
139
140...
141---
142name:            int32_to_float
143alignment:       16
144tracksRegLiveness: true
145registers:
146  - { id: 0, class: _ }
147  - { id: 1, class: _ }
148  - { id: 2, class: _ }
149body:             |
150  bb.1.entry:
151    liveins: $edi
152
153    ; CHECK-LABEL: name: int32_to_float
154    ; CHECK: liveins: $edi
155    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
156    ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s32)
157    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s32)
158    ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
159    ; CHECK: RET 0, implicit $xmm0
160    %0:_(s32) = COPY $edi
161    %1:_(s32) = G_SITOFP %0(s32)
162    %2:_(s128) = G_ANYEXT %1(s32)
163    $xmm0 = COPY %2(s128)
164    RET 0, implicit $xmm0
165
166...
167---
168name:            int64_to_float
169alignment:       16
170tracksRegLiveness: true
171registers:
172  - { id: 0, class: _ }
173  - { id: 1, class: _ }
174  - { id: 2, class: _ }
175body:             |
176  bb.1.entry:
177    liveins: $rdi
178
179    ; CHECK-LABEL: name: int64_to_float
180    ; CHECK: liveins: $rdi
181    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $rdi
182    ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s64)
183    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s32)
184    ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
185    ; CHECK: RET 0, implicit $xmm0
186    %0:_(s64) = COPY $rdi
187    %1:_(s32) = G_SITOFP %0(s64)
188    %2:_(s128) = G_ANYEXT %1(s32)
189    $xmm0 = COPY %2(s128)
190    RET 0, implicit $xmm0
191
192...
193---
194name:            int8_to_double
195alignment:       16
196tracksRegLiveness: true
197registers:
198  - { id: 0, class: _ }
199  - { id: 1, class: _ }
200  - { id: 2, class: _ }
201  - { id: 3, class: _ }
202body:             |
203  bb.1.entry:
204    liveins: $edi
205
206    ; CHECK-LABEL: name: int8_to_double
207    ; CHECK: liveins: $edi
208    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
209    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
210    ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 24
211    ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s8)
212    ; CHECK: [[COPY2:%[0-9]+]]:_(s8) = COPY [[C]](s8)
213    ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[COPY2]](s8)
214    ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s32)
215    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s64)
216    ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
217    ; CHECK: RET 0, implicit $xmm0
218    %1:_(s32) = COPY $edi
219    %0:_(s8) = G_TRUNC %1(s32)
220    %2:_(s64) = G_SITOFP %0(s8)
221    %3:_(s128) = G_ANYEXT %2(s64)
222    $xmm0 = COPY %3(s128)
223    RET 0, implicit $xmm0
224
225...
226---
227name:            int16_to_double
228alignment:       16
229tracksRegLiveness: true
230registers:
231  - { id: 0, class: _ }
232  - { id: 1, class: _ }
233  - { id: 2, class: _ }
234  - { id: 3, class: _ }
235body:             |
236  bb.1.entry:
237    liveins: $edi
238
239    ; CHECK-LABEL: name: int16_to_double
240    ; CHECK: liveins: $edi
241    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
242    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
243    ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 16
244    ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s8)
245    ; CHECK: [[COPY2:%[0-9]+]]:_(s8) = COPY [[C]](s8)
246    ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[COPY2]](s8)
247    ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s32)
248    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s64)
249    ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
250    ; CHECK: RET 0, implicit $xmm0
251    %1:_(s32) = COPY $edi
252    %0:_(s16) = G_TRUNC %1(s32)
253    %2:_(s64) = G_SITOFP %0(s16)
254    %3:_(s128) = G_ANYEXT %2(s64)
255    $xmm0 = COPY %3(s128)
256    RET 0, implicit $xmm0
257
258...
259---
260name:            int32_to_double
261alignment:       16
262tracksRegLiveness: true
263registers:
264  - { id: 0, class: _ }
265  - { id: 1, class: _ }
266  - { id: 2, class: _ }
267body:             |
268  bb.1.entry:
269    liveins: $edi
270
271    ; CHECK-LABEL: name: int32_to_double
272    ; CHECK: liveins: $edi
273    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
274    ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s32)
275    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s64)
276    ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
277    ; CHECK: RET 0, implicit $xmm0
278    %0:_(s32) = COPY $edi
279    %1:_(s64) = G_SITOFP %0(s32)
280    %2:_(s128) = G_ANYEXT %1(s64)
281    $xmm0 = COPY %2(s128)
282    RET 0, implicit $xmm0
283
284...
285---
286name:            int64_to_double
287alignment:       16
288tracksRegLiveness: true
289registers:
290  - { id: 0, class: _ }
291  - { id: 1, class: _ }
292  - { id: 2, class: _ }
293body:             |
294  bb.1.entry:
295    liveins: $rdi
296
297    ; CHECK-LABEL: name: int64_to_double
298    ; CHECK: liveins: $rdi
299    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $rdi
300    ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s64)
301    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s64)
302    ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
303    ; CHECK: RET 0, implicit $xmm0
304    %0:_(s64) = COPY $rdi
305    %1:_(s64) = G_SITOFP %0(s64)
306    %2:_(s128) = G_ANYEXT %1(s64)
307    $xmm0 = COPY %2(s128)
308    RET 0, implicit $xmm0
309
310...
311