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_sitofp_s32_s16() { ret void }
28 define void @test_uitofp_s32_s16() { ret void }
32 name: test_sitofp_s32_s32
36 ; CHECK-LABEL: name: test_sitofp_s32_s32
37 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
38 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s32)
39 ; CHECK: $w0 = COPY [[SITOFP]](s32)
41 %1:_(s32) = G_SITOFP %0
46 name: test_uitofp_s32_s32
50 ; CHECK-LABEL: name: test_uitofp_s32_s32
51 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
52 ; CHECK: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[COPY]](s32)
53 ; CHECK: $w0 = COPY [[UITOFP]](s32)
55 %1:_(s32) = G_UITOFP %0
60 name: test_sitofp_s32_s64
64 ; CHECK-LABEL: name: test_sitofp_s32_s64
65 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
66 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s64)
67 ; CHECK: $w0 = COPY [[SITOFP]](s32)
69 %1:_(s32) = G_SITOFP %0
74 name: test_uitofp_s32_s64
78 ; CHECK-LABEL: name: test_uitofp_s32_s64
79 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
80 ; CHECK: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[COPY]](s64)
81 ; CHECK: $w0 = COPY [[UITOFP]](s32)
83 %1:_(s32) = G_UITOFP %0
88 name: test_sitofp_s64_s32
92 ; CHECK-LABEL: name: test_sitofp_s64_s32
93 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
94 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s32)
95 ; CHECK: $x0 = COPY [[SITOFP]](s64)
97 %1:_(s64) = G_SITOFP %0
102 name: test_uitofp_s64_s32
106 ; CHECK-LABEL: name: test_uitofp_s64_s32
107 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
108 ; CHECK: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[COPY]](s32)
109 ; CHECK: $x0 = COPY [[UITOFP]](s64)
111 %1:_(s64) = G_UITOFP %0
116 name: test_sitofp_s64_s64
120 ; CHECK-LABEL: name: test_sitofp_s64_s64
121 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
122 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s64)
123 ; CHECK: $x0 = COPY [[SITOFP]](s64)
125 %1:_(s64) = G_SITOFP %0
130 name: test_uitofp_s64_s64
134 ; CHECK-LABEL: name: test_uitofp_s64_s64
135 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
136 ; CHECK: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[COPY]](s64)
137 ; CHECK: $x0 = COPY [[UITOFP]](s64)
139 %1:_(s64) = G_UITOFP %0
145 name: test_sitofp_s32_s1
149 ; CHECK-LABEL: name: test_sitofp_s32_s1
150 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
151 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
152 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
153 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
154 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 31
155 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C1]](s64)
156 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](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: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
191 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
192 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 24
193 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C1]](s64)
194 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s32)
195 ; CHECK: $x0 = COPY [[SITOFP]](s64)
197 %1:_(s8) = G_TRUNC %0
198 %2:_(s64) = G_SITOFP %1
203 name: test_uitofp_s64_s8
207 ; CHECK-LABEL: name: test_uitofp_s64_s8
208 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
209 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
210 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
211 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
212 ; CHECK: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[AND]](s32)
213 ; CHECK: $x0 = COPY [[UITOFP]](s64)
215 %1:_(s8) = G_TRUNC %0
216 %2:_(s64) = G_UITOFP %1
221 name: test_sitofp_v4s32
225 ; CHECK-LABEL: name: test_sitofp_v4s32
226 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
227 ; CHECK: [[SITOFP:%[0-9]+]]:_(<4 x s32>) = G_SITOFP [[SITOFP]](<4 x s32>)
228 ; CHECK: $q0 = COPY [[SITOFP]](<4 x s32>)
229 %0:_(<4 x s32>) = COPY $q0
230 %1:_(<4 x s32>) = G_SITOFP %1
235 name: test_uitofp_v4s32
239 ; CHECK-LABEL: name: test_uitofp_v4s32
240 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
241 ; CHECK: [[UITOFP:%[0-9]+]]:_(<4 x s32>) = G_UITOFP [[UITOFP]](<4 x s32>)
242 ; CHECK: $q0 = COPY [[UITOFP]](<4 x s32>)
243 %0:_(<4 x s32>) = COPY $q0
244 %1:_(<4 x s32>) = G_UITOFP %1
249 name: test_sitofp_s32_s16
253 ; CHECK-LABEL: name: test_sitofp_s32_s16
254 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
255 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
256 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
257 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
258 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
259 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C1]](s64)
260 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s32)
261 ; CHECK: $w0 = COPY [[SITOFP]](s32)
263 %1:_(s16) = G_TRUNC %0
264 %2:_(s32) = G_SITOFP %1
269 name: test_uitofp_s32_s16
273 ; CHECK-LABEL: name: test_uitofp_s32_s16
274 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
275 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
276 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
277 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
278 ; CHECK: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s32)
279 ; CHECK: $w0 = COPY [[UITOFP]](s32)
281 %1:_(s16) = G_TRUNC %0
282 %2:_(s32) = G_UITOFP %1