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
40 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
41 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s32)
42 ; CHECK: $w0 = COPY [[SITOFP]](s32)
44 %1:_(s32) = G_SITOFP %0
49 name: test_uitofp_s32_s32
53 ; CHECK-LABEL: name: test_uitofp_s32_s32
54 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
55 ; CHECK: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[COPY]](s32)
56 ; CHECK: $w0 = COPY [[UITOFP]](s32)
58 %1:_(s32) = G_UITOFP %0
63 name: test_sitofp_s32_s64
67 ; CHECK-LABEL: name: test_sitofp_s32_s64
68 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
69 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s64)
70 ; CHECK: $w0 = COPY [[SITOFP]](s32)
72 %1:_(s32) = G_SITOFP %0
77 name: test_uitofp_s32_s64
81 ; CHECK-LABEL: name: test_uitofp_s32_s64
82 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
83 ; CHECK: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[COPY]](s64)
84 ; CHECK: $w0 = COPY [[UITOFP]](s32)
86 %1:_(s32) = G_UITOFP %0
91 name: test_sitofp_s64_s32
95 ; CHECK-LABEL: name: test_sitofp_s64_s32
96 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
97 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s32)
98 ; CHECK: $x0 = COPY [[SITOFP]](s64)
100 %1:_(s64) = G_SITOFP %0
105 name: test_uitofp_s64_s32
109 ; CHECK-LABEL: name: test_uitofp_s64_s32
110 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
111 ; CHECK: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[COPY]](s32)
112 ; CHECK: $x0 = COPY [[UITOFP]](s64)
114 %1:_(s64) = G_UITOFP %0
119 name: test_sitofp_s64_s64
123 ; CHECK-LABEL: name: test_sitofp_s64_s64
124 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
125 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s64)
126 ; CHECK: $x0 = COPY [[SITOFP]](s64)
128 %1:_(s64) = G_SITOFP %0
133 name: test_uitofp_s64_s64
137 ; CHECK-LABEL: name: test_uitofp_s64_s64
138 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
139 ; CHECK: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[COPY]](s64)
140 ; CHECK: $x0 = COPY [[UITOFP]](s64)
142 %1:_(s64) = G_UITOFP %0
148 name: test_sitofp_s32_s1
152 ; CHECK-LABEL: name: test_sitofp_s32_s1
153 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
154 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
155 ; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY1]], 1
156 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[SEXT_INREG]](s32)
157 ; CHECK: $w0 = COPY [[SITOFP]](s32)
159 %1:_(s1) = G_TRUNC %0
160 %2:_(s32) = G_SITOFP %1
165 name: test_uitofp_s32_s1
169 ; CHECK-LABEL: name: test_uitofp_s32_s1
170 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
171 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
172 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
173 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
174 ; CHECK: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s32)
175 ; CHECK: $w0 = COPY [[UITOFP]](s32)
177 %1:_(s1) = G_TRUNC %0
178 %2:_(s32) = G_UITOFP %1
183 name: test_sitofp_s64_s8
187 ; CHECK-LABEL: name: test_sitofp_s64_s8
188 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
189 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
190 ; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY1]], 8
191 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[SEXT_INREG]](s32)
192 ; CHECK: $x0 = COPY [[SITOFP]](s64)
194 %1:_(s8) = G_TRUNC %0
195 %2:_(s64) = G_SITOFP %1
200 name: test_uitofp_s64_s8
204 ; CHECK-LABEL: name: test_uitofp_s64_s8
205 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
206 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
207 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
208 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
209 ; CHECK: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[AND]](s32)
210 ; CHECK: $x0 = COPY [[UITOFP]](s64)
212 %1:_(s8) = G_TRUNC %0
213 %2:_(s64) = G_UITOFP %1
218 name: test_sitofp_v4s32
222 ; CHECK-LABEL: name: test_sitofp_v4s32
223 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
224 ; CHECK: [[SITOFP:%[0-9]+]]:_(<4 x s32>) = G_SITOFP [[SITOFP]](<4 x s32>)
225 ; CHECK: $q0 = COPY [[SITOFP]](<4 x s32>)
226 %0:_(<4 x s32>) = COPY $q0
227 %1:_(<4 x s32>) = G_SITOFP %1
232 name: test_uitofp_v4s32
236 ; CHECK-LABEL: name: test_uitofp_v4s32
237 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
238 ; CHECK: [[UITOFP:%[0-9]+]]:_(<4 x s32>) = G_UITOFP [[UITOFP]](<4 x s32>)
239 ; CHECK: $q0 = COPY [[UITOFP]](<4 x s32>)
240 %0:_(<4 x s32>) = COPY $q0
241 %1:_(<4 x s32>) = G_UITOFP %1
246 name: test_uitofp_v2s64_v2i1
250 ; CHECK-LABEL: name: test_uitofp_v2s64_v2i1
251 ; CHECK: [[DEF:%[0-9]+]]:_(s1) = G_IMPLICIT_DEF
252 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s1>) = G_BUILD_VECTOR [[DEF]](s1), [[DEF]](s1)
253 ; CHECK: [[ZEXT:%[0-9]+]]:_(<2 x s64>) = G_ZEXT [[BUILD_VECTOR]](<2 x s1>)
254 ; CHECK: [[UITOFP:%[0-9]+]]:_(<2 x s64>) = G_UITOFP [[ZEXT]](<2 x s64>)
255 ; CHECK: $q0 = COPY [[UITOFP]](<2 x s64>)
256 %0:_(<2 x s1>) = G_IMPLICIT_DEF
257 %1:_(<2 x s64>) = G_UITOFP %0
262 name: test_sitofp_v2s64_v2i1
266 ; CHECK-LABEL: name: test_sitofp_v2s64_v2i1
267 ; CHECK: [[DEF:%[0-9]+]]:_(s1) = G_IMPLICIT_DEF
268 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s1>) = G_BUILD_VECTOR [[DEF]](s1), [[DEF]](s1)
269 ; CHECK: [[SEXT:%[0-9]+]]:_(<2 x s64>) = G_SEXT [[BUILD_VECTOR]](<2 x s1>)
270 ; CHECK: [[SITOFP:%[0-9]+]]:_(<2 x s64>) = G_SITOFP [[SEXT]](<2 x s64>)
271 ; CHECK: $q0 = COPY [[SITOFP]](<2 x s64>)
272 %0:_(<2 x s1>) = G_IMPLICIT_DEF
273 %1:_(<2 x s64>) = G_SITOFP %0
278 name: test_sitofp_s32_s16
282 ; CHECK-LABEL: name: test_sitofp_s32_s16
283 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
284 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
285 ; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY1]], 16
286 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[SEXT_INREG]](s32)
287 ; CHECK: $w0 = COPY [[SITOFP]](s32)
289 %1:_(s16) = G_TRUNC %0
290 %2:_(s32) = G_SITOFP %1
295 name: test_uitofp_s32_s16
299 ; CHECK-LABEL: name: test_uitofp_s32_s16
300 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
301 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
302 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
303 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
304 ; CHECK: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s32)
305 ; CHECK: $w0 = COPY [[UITOFP]](s32)
307 %1:_(s16) = G_TRUNC %0
308 %2:_(s32) = G_UITOFP %1