1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -run-pass=legalizer %s -o - | FileCheck %s
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
6 target triple = "aarch64--"
8 define void @test_sitofp_s32_s32() { ret void }
9 define void @test_uitofp_s32_s32() { ret void }
10 define void @test_sitofp_s32_s64() { ret void }
11 define void @test_uitofp_s32_s64() { ret void }
13 define void @test_sitofp_s64_s32() { ret void }
14 define void @test_uitofp_s64_s32() { ret void }
15 define void @test_sitofp_s64_s64() { ret void }
16 define void @test_uitofp_s64_s64() { ret void }
18 define void @test_sitofp_s32_s1() { ret void }
19 define void @test_uitofp_s32_s1() { ret void }
21 define void @test_sitofp_s64_s8() { ret void }
22 define void @test_uitofp_s64_s8() { ret void }
24 define void @test_sitofp_v4s32() { ret void }
25 define void @test_uitofp_v4s32() { ret void }
27 define void @test_uitofp_v2s64_v2i1() { ret void }
28 define void @test_sitofp_v2s64_v2i1() { ret void }
30 define void @test_sitofp_s32_s16() { ret void }
31 define void @test_uitofp_s32_s16() { ret void }
35 name: test_sitofp_s32_s32
39 ; CHECK-LABEL: name: test_sitofp_s32_s32
42 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
43 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s32)
44 ; CHECK-NEXT: $w0 = COPY [[SITOFP]](s32)
46 %1:_(s32) = G_SITOFP %0
51 name: test_uitofp_s32_s32
55 ; CHECK-LABEL: name: test_uitofp_s32_s32
58 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
59 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[COPY]](s32)
60 ; CHECK-NEXT: $w0 = COPY [[UITOFP]](s32)
62 %1:_(s32) = G_UITOFP %0
67 name: test_sitofp_s32_s64
71 ; CHECK-LABEL: name: test_sitofp_s32_s64
74 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
75 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s64)
76 ; CHECK-NEXT: $w0 = COPY [[SITOFP]](s32)
78 %1:_(s32) = G_SITOFP %0
83 name: test_uitofp_s32_s64
87 ; CHECK-LABEL: name: test_uitofp_s32_s64
90 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
91 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[COPY]](s64)
92 ; CHECK-NEXT: $w0 = COPY [[UITOFP]](s32)
94 %1:_(s32) = G_UITOFP %0
99 name: test_sitofp_s64_s32
103 ; CHECK-LABEL: name: test_sitofp_s64_s32
104 ; CHECK: liveins: $w0
106 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
107 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s32)
108 ; CHECK-NEXT: $x0 = COPY [[SITOFP]](s64)
110 %1:_(s64) = G_SITOFP %0
115 name: test_uitofp_s64_s32
119 ; CHECK-LABEL: name: test_uitofp_s64_s32
120 ; CHECK: liveins: $w0
122 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
123 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[COPY]](s32)
124 ; CHECK-NEXT: $x0 = COPY [[UITOFP]](s64)
126 %1:_(s64) = G_UITOFP %0
131 name: test_sitofp_s64_s64
135 ; CHECK-LABEL: name: test_sitofp_s64_s64
136 ; CHECK: liveins: $x0
138 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
139 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s64)
140 ; CHECK-NEXT: $x0 = COPY [[SITOFP]](s64)
142 %1:_(s64) = G_SITOFP %0
147 name: test_uitofp_s64_s64
151 ; CHECK-LABEL: name: test_uitofp_s64_s64
152 ; CHECK: liveins: $x0
154 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
155 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[COPY]](s64)
156 ; CHECK-NEXT: $x0 = COPY [[UITOFP]](s64)
158 %1:_(s64) = G_UITOFP %0
164 name: test_sitofp_s32_s1
168 ; CHECK-LABEL: name: test_sitofp_s32_s1
169 ; CHECK: liveins: $w0
171 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
172 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY]], 1
173 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[SEXT_INREG]](s32)
174 ; CHECK-NEXT: $w0 = COPY [[SITOFP]](s32)
176 %1:_(s1) = G_TRUNC %0
177 %2:_(s32) = G_SITOFP %1
182 name: test_uitofp_s32_s1
186 ; CHECK-LABEL: name: test_uitofp_s32_s1
187 ; CHECK: liveins: $w0
189 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
190 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
191 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
192 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s32)
193 ; CHECK-NEXT: $w0 = COPY [[UITOFP]](s32)
195 %1:_(s1) = G_TRUNC %0
196 %2:_(s32) = G_UITOFP %1
201 name: test_sitofp_s64_s8
205 ; CHECK-LABEL: name: test_sitofp_s64_s8
206 ; CHECK: liveins: $w0
208 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
209 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY]], 8
210 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[SEXT_INREG]](s32)
211 ; CHECK-NEXT: $x0 = COPY [[SITOFP]](s64)
213 %1:_(s8) = G_TRUNC %0
214 %2:_(s64) = G_SITOFP %1
219 name: test_uitofp_s64_s8
223 ; CHECK-LABEL: name: test_uitofp_s64_s8
224 ; CHECK: liveins: $w0
226 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
227 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
228 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
229 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[AND]](s32)
230 ; CHECK-NEXT: $x0 = COPY [[UITOFP]](s64)
232 %1:_(s8) = G_TRUNC %0
233 %2:_(s64) = G_UITOFP %1
238 name: test_sitofp_v4s32
242 ; CHECK-LABEL: name: test_sitofp_v4s32
243 ; CHECK: liveins: $q0
245 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
246 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(<4 x s32>) = G_SITOFP [[SITOFP]](<4 x s32>)
247 ; CHECK-NEXT: $q0 = COPY [[SITOFP]](<4 x s32>)
248 %0:_(<4 x s32>) = COPY $q0
249 %1:_(<4 x s32>) = G_SITOFP %1
254 name: test_uitofp_v4s32
258 ; CHECK-LABEL: name: test_uitofp_v4s32
259 ; CHECK: liveins: $q0
261 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
262 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(<4 x s32>) = G_UITOFP [[UITOFP]](<4 x s32>)
263 ; CHECK-NEXT: $q0 = COPY [[UITOFP]](<4 x s32>)
264 %0:_(<4 x s32>) = COPY $q0
265 %1:_(<4 x s32>) = G_UITOFP %1
270 name: test_uitofp_v2s64_v2i1
274 ; CHECK-LABEL: name: test_uitofp_v2s64_v2i1
275 ; CHECK: liveins: $q0
277 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
278 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[C]](s64), [[C]](s64)
279 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
280 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY [[DEF]](s64)
281 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[DEF]](s64), [[COPY]](s64)
282 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(<2 x s64>) = G_AND [[BUILD_VECTOR1]], [[BUILD_VECTOR]]
283 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(<2 x s64>) = G_UITOFP [[AND]](<2 x s64>)
284 ; CHECK-NEXT: $q0 = COPY [[UITOFP]](<2 x s64>)
285 %0:_(<2 x s1>) = G_IMPLICIT_DEF
286 %1:_(<2 x s64>) = G_UITOFP %0
291 name: test_sitofp_v2s64_v2i1
295 ; CHECK-LABEL: name: test_sitofp_v2s64_v2i1
296 ; CHECK: liveins: $q0
298 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
299 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY [[DEF]](s64)
300 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[DEF]](s64), [[COPY]](s64)
301 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(<2 x s64>) = G_SEXT_INREG [[BUILD_VECTOR]], 1
302 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(<2 x s64>) = G_SITOFP [[SEXT_INREG]](<2 x s64>)
303 ; CHECK-NEXT: $q0 = COPY [[SITOFP]](<2 x s64>)
304 %0:_(<2 x s1>) = G_IMPLICIT_DEF
305 %1:_(<2 x s64>) = G_SITOFP %0
310 name: test_sitofp_s32_s16
314 ; CHECK-LABEL: name: test_sitofp_s32_s16
315 ; CHECK: liveins: $w0
317 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
318 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY]], 16
319 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[SEXT_INREG]](s32)
320 ; CHECK-NEXT: $w0 = COPY [[SITOFP]](s32)
322 %1:_(s16) = G_TRUNC %0
323 %2:_(s32) = G_SITOFP %1
328 name: test_uitofp_s32_s16
332 ; CHECK-LABEL: name: test_uitofp_s32_s16
333 ; CHECK: liveins: $w0
335 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
336 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
337 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
338 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s32)
339 ; CHECK-NEXT: $w0 = COPY [[UITOFP]](s32)
341 %1:_(s16) = G_TRUNC %0
342 %2:_(s32) = G_UITOFP %1