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
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"
10 ; Function Attrs: norecurse nounwind readnone uwtable
11 define dso_local float @int8_to_float(i8 signext %a) local_unnamed_addr #0 {
13 %conv = sitofp i8 %a to float
17 ; Function Attrs: norecurse nounwind readnone uwtable
18 define dso_local float @int16_to_float(i16 signext %a) local_unnamed_addr #0 {
20 %conv = sitofp i16 %a to float
24 ; Function Attrs: norecurse nounwind readnone uwtable
25 define dso_local float @int32_to_float(i32 %a) local_unnamed_addr #0 {
27 %conv = sitofp i32 %a to float
31 ; Function Attrs: norecurse nounwind readnone uwtable
32 define dso_local float @int64_to_float(i64 %a) local_unnamed_addr #0 {
34 %conv = sitofp i64 %a to float
38 ; Function Attrs: norecurse nounwind readnone uwtable
39 define dso_local double @int8_to_double(i8 signext %a) local_unnamed_addr #0 {
41 %conv = sitofp i8 %a to double
45 ; Function Attrs: norecurse nounwind readnone uwtable
46 define dso_local double @int16_to_double(i16 signext %a) local_unnamed_addr #0 {
48 %conv = sitofp i16 %a to double
52 ; Function Attrs: norecurse nounwind readnone uwtable
53 define dso_local double @int32_to_double(i32 %a) local_unnamed_addr #0 {
55 %conv = sitofp i32 %a to double
59 ; Function Attrs: norecurse nounwind readnone uwtable
60 define dso_local double @int64_to_double(i64 %a) local_unnamed_addr #0 {
62 %conv = sitofp i64 %a to double
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" }
68 !llvm.module.flags = !{!0}
71 !0 = !{i32 1, !"wchar_size", i32 4}
72 !1 = !{!"clang version 7.0.0"}
78 tracksRegLiveness: true
88 ; CHECK-LABEL: name: int8_to_float
89 ; CHECK: liveins: $edi
90 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
91 ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 24
92 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s8)
93 ; CHECK: [[COPY1:%[0-9]+]]:_(s8) = COPY [[C]](s8)
94 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[COPY1]](s8)
95 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s32)
96 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s32)
97 ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
98 ; CHECK: RET 0, implicit $xmm0
100 %0:_(s8) = G_TRUNC %1(s32)
101 %2:_(s32) = G_SITOFP %0(s8)
102 %3:_(s128) = G_ANYEXT %2(s32)
103 $xmm0 = COPY %3(s128)
104 RET 0, implicit $xmm0
110 tracksRegLiveness: true
112 - { id: 0, class: _ }
113 - { id: 1, class: _ }
114 - { id: 2, class: _ }
115 - { id: 3, class: _ }
120 ; CHECK-LABEL: name: int16_to_float
121 ; CHECK: liveins: $edi
122 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
123 ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 16
124 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s8)
125 ; CHECK: [[COPY1:%[0-9]+]]:_(s8) = COPY [[C]](s8)
126 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[COPY1]](s8)
127 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s32)
128 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s32)
129 ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
130 ; CHECK: RET 0, implicit $xmm0
131 %1:_(s32) = COPY $edi
132 %0:_(s16) = G_TRUNC %1(s32)
133 %2:_(s32) = G_SITOFP %0(s16)
134 %3:_(s128) = G_ANYEXT %2(s32)
135 $xmm0 = COPY %3(s128)
136 RET 0, implicit $xmm0
142 tracksRegLiveness: true
144 - { id: 0, class: _ }
145 - { id: 1, class: _ }
146 - { id: 2, class: _ }
151 ; CHECK-LABEL: name: int32_to_float
152 ; CHECK: liveins: $edi
153 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
154 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s32)
155 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s32)
156 ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
157 ; CHECK: RET 0, implicit $xmm0
158 %0:_(s32) = COPY $edi
159 %1:_(s32) = G_SITOFP %0(s32)
160 %2:_(s128) = G_ANYEXT %1(s32)
161 $xmm0 = COPY %2(s128)
162 RET 0, implicit $xmm0
168 tracksRegLiveness: true
170 - { id: 0, class: _ }
171 - { id: 1, class: _ }
172 - { id: 2, class: _ }
177 ; CHECK-LABEL: name: int64_to_float
178 ; CHECK: liveins: $rdi
179 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $rdi
180 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s64)
181 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s32)
182 ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
183 ; CHECK: RET 0, implicit $xmm0
184 %0:_(s64) = COPY $rdi
185 %1:_(s32) = G_SITOFP %0(s64)
186 %2:_(s128) = G_ANYEXT %1(s32)
187 $xmm0 = COPY %2(s128)
188 RET 0, implicit $xmm0
194 tracksRegLiveness: true
196 - { id: 0, class: _ }
197 - { id: 1, class: _ }
198 - { id: 2, class: _ }
199 - { id: 3, class: _ }
204 ; CHECK-LABEL: name: int8_to_double
205 ; CHECK: liveins: $edi
206 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
207 ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 24
208 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s8)
209 ; CHECK: [[COPY1:%[0-9]+]]:_(s8) = COPY [[C]](s8)
210 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[COPY1]](s8)
211 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s32)
212 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s64)
213 ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
214 ; CHECK: RET 0, implicit $xmm0
215 %1:_(s32) = COPY $edi
216 %0:_(s8) = G_TRUNC %1(s32)
217 %2:_(s64) = G_SITOFP %0(s8)
218 %3:_(s128) = G_ANYEXT %2(s64)
219 $xmm0 = COPY %3(s128)
220 RET 0, implicit $xmm0
224 name: int16_to_double
226 tracksRegLiveness: true
228 - { id: 0, class: _ }
229 - { id: 1, class: _ }
230 - { id: 2, class: _ }
231 - { id: 3, class: _ }
236 ; CHECK-LABEL: name: int16_to_double
237 ; CHECK: liveins: $edi
238 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
239 ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 16
240 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s8)
241 ; CHECK: [[COPY1:%[0-9]+]]:_(s8) = COPY [[C]](s8)
242 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[COPY1]](s8)
243 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s32)
244 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s64)
245 ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
246 ; CHECK: RET 0, implicit $xmm0
247 %1:_(s32) = COPY $edi
248 %0:_(s16) = G_TRUNC %1(s32)
249 %2:_(s64) = G_SITOFP %0(s16)
250 %3:_(s128) = G_ANYEXT %2(s64)
251 $xmm0 = COPY %3(s128)
252 RET 0, implicit $xmm0
256 name: int32_to_double
258 tracksRegLiveness: true
260 - { id: 0, class: _ }
261 - { id: 1, class: _ }
262 - { id: 2, class: _ }
267 ; CHECK-LABEL: name: int32_to_double
268 ; CHECK: liveins: $edi
269 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
270 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s32)
271 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s64)
272 ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
273 ; CHECK: RET 0, implicit $xmm0
274 %0:_(s32) = COPY $edi
275 %1:_(s64) = G_SITOFP %0(s32)
276 %2:_(s128) = G_ANYEXT %1(s64)
277 $xmm0 = COPY %2(s128)
278 RET 0, implicit $xmm0
282 name: int64_to_double
284 tracksRegLiveness: true
286 - { id: 0, class: _ }
287 - { id: 1, class: _ }
288 - { id: 2, class: _ }
293 ; CHECK-LABEL: name: int64_to_double
294 ; CHECK: liveins: $rdi
295 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $rdi
296 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s64)
297 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[SITOFP]](s64)
298 ; CHECK: $xmm0 = COPY [[ANYEXT]](s128)
299 ; CHECK: RET 0, implicit $xmm0
300 %0:_(s64) = COPY $rdi
301 %1:_(s64) = G_SITOFP %0(s64)
302 %2:_(s128) = G_ANYEXT %1(s64)
303 $xmm0 = COPY %2(s128)
304 RET 0, implicit $xmm0