1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
7 tracksRegLiveness: true
10 liveins: $x0, $x1, $x2
13 ; CHECK-LABEL: name: test_extracts_4
14 ; CHECK: liveins: $x0, $x1, $x2
15 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
16 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
17 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s64), 32
18 ; CHECK: $w0 = COPY [[EXTRACT]](s32)
19 ; CHECK: RET_ReallyLR implicit $w0
22 %2:_(s128) = G_MERGE_VALUES %0, %1
23 %3:_(s32) = G_EXTRACT %2, 32
25 RET_ReallyLR implicit $w0
29 tracksRegLiveness: true
33 ; CHECK-LABEL: name: p0_from_s128
34 ; CHECK: liveins: $x0, $q0
35 ; CHECK: %val:_(s128) = COPY $q0
36 ; CHECK: %extract:_(p0) = G_EXTRACT %val(s128), 0
37 ; CHECK: $x0 = COPY %extract(p0)
38 ; CHECK: RET_ReallyLR implicit $x0
39 %val:_(s128) = COPY $q0
40 %extract:_(p0) = G_EXTRACT %val, 0
42 RET_ReallyLR implicit $x0
46 tracksRegLiveness: true
50 ; CHECK-LABEL: name: s64_from_s128
51 ; CHECK: liveins: $x0, $q0
52 ; CHECK: %val:_(s128) = COPY $q0
53 ; CHECK: %extract:_(s64) = G_EXTRACT %val(s128), 0
54 ; CHECK: $x0 = COPY %extract(s64)
55 ; CHECK: RET_ReallyLR implicit $x0
56 %val:_(s128) = COPY $q0
57 %extract:_(s64) = G_EXTRACT %val, 0
59 RET_ReallyLR implicit $x0
63 tracksRegLiveness: true
67 ; CHECK-LABEL: name: s32_from_s128
68 ; CHECK: liveins: $w0, $q0
69 ; CHECK: %val:_(s128) = COPY $q0
70 ; CHECK: %extract:_(s32) = G_EXTRACT %val(s128), 0
71 ; CHECK: $w0 = COPY %extract(s32)
72 ; CHECK: RET_ReallyLR implicit $w0
73 %val:_(s128) = COPY $q0
74 %extract:_(s32) = G_EXTRACT %val, 0
76 RET_ReallyLR implicit $w0
80 tracksRegLiveness: true
84 ; CHECK-LABEL: name: s32_from_s64
86 ; CHECK: %val:_(s64) = COPY $x0
87 ; CHECK: %extract:_(s32) = G_EXTRACT %val(s64), 0
88 ; CHECK: $w0 = COPY %extract(s32)
89 ; CHECK: RET_ReallyLR implicit $w0
90 %val:_(s64) = COPY $x0
91 %extract:_(s32) = G_EXTRACT %val, 0
93 RET_ReallyLR implicit $w0
97 tracksRegLiveness: true
101 ; CHECK-LABEL: name: s32_from_p0
102 ; CHECK: liveins: $w0
103 ; CHECK: %val:_(p0) = COPY $x0
104 ; CHECK: %extract:_(s32) = G_EXTRACT %val(p0), 0
105 ; CHECK: $w0 = COPY %extract(s32)
106 ; CHECK: RET_ReallyLR implicit $w0
107 %val:_(p0) = COPY $x0
108 %extract:_(s32) = G_EXTRACT %val, 0
110 RET_ReallyLR implicit $w0
114 tracksRegLiveness: true
118 ; CHECK-LABEL: name: s16_from_s128
119 ; CHECK: liveins: $h0, $q0
120 ; CHECK: %val:_(s128) = COPY $q0
121 ; CHECK: %extract:_(s16) = G_EXTRACT %val(s128), 0
122 ; CHECK: $h0 = COPY %extract(s16)
123 ; CHECK: RET_ReallyLR implicit $h0
124 %val:_(s128) = COPY $q0
125 %extract:_(s16) = G_EXTRACT %val, 0
127 RET_ReallyLR implicit $h0
131 tracksRegLiveness: true
135 ; CHECK-LABEL: name: s16_from_s64
136 ; CHECK: liveins: $h0, $x0
137 ; CHECK: %val:_(s64) = COPY $x0
138 ; CHECK: %extract:_(s16) = G_EXTRACT %val(s64), 0
139 ; CHECK: $h0 = COPY %extract(s16)
140 ; CHECK: RET_ReallyLR implicit $h0
141 %val:_(s64) = COPY $x0
142 %extract:_(s16) = G_EXTRACT %val, 0
144 RET_ReallyLR implicit $h0
148 tracksRegLiveness: true
152 ; CHECK-LABEL: name: s16_from_s32
153 ; CHECK: liveins: $h0, $w0
154 ; CHECK: %val:_(s32) = COPY $w0
155 ; CHECK: %extract:_(s16) = G_EXTRACT %val(s32), 0
156 ; CHECK: $h0 = COPY %extract(s16)
157 ; CHECK: RET_ReallyLR implicit $h0
158 %val:_(s32) = COPY $w0
159 %extract:_(s16) = G_EXTRACT %val, 0
161 RET_ReallyLR implicit $h0
165 tracksRegLiveness: true
169 ; CHECK-LABEL: name: s8_from_s128
170 ; CHECK: liveins: $b0, $q0
171 ; CHECK: %val:_(s128) = COPY $q0
172 ; CHECK: %extract:_(s8) = G_TRUNC %val(s128)
173 ; CHECK: $b0 = COPY %extract(s8)
174 ; CHECK: RET_ReallyLR implicit $b0
175 %val:_(s128) = COPY $q0
176 %extract:_(s8) = G_EXTRACT %val, 0
178 RET_ReallyLR implicit $b0
182 tracksRegLiveness: true
186 ; CHECK-LABEL: name: s8_from_s64
187 ; CHECK: liveins: $b0, $x0
188 ; CHECK: %val:_(s64) = COPY $x0
189 ; CHECK: %extract:_(s8) = G_TRUNC %val(s64)
190 ; CHECK: $b0 = COPY %extract(s8)
191 ; CHECK: RET_ReallyLR implicit $b0
192 %val:_(s64) = COPY $x0
193 %extract:_(s8) = G_EXTRACT %val, 0
195 RET_ReallyLR implicit $b0
199 tracksRegLiveness: true
203 ; CHECK-LABEL: name: s8_from_s32
204 ; CHECK: liveins: $b0, $w0
205 ; CHECK: %val:_(s32) = COPY $w0
206 ; CHECK: %extract:_(s8) = G_TRUNC %val(s32)
207 ; CHECK: $b0 = COPY %extract(s8)
208 ; CHECK: RET_ReallyLR implicit $b0
209 %val:_(s32) = COPY $w0
210 %extract:_(s8) = G_EXTRACT %val, 0
212 RET_ReallyLR implicit $b0
216 tracksRegLiveness: true
220 ; CHECK-LABEL: name: s8_from_s16
221 ; CHECK: liveins: $b0, $h0
222 ; CHECK: %val:_(s16) = COPY $h0
223 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT %val(s16)
224 ; CHECK: %extract:_(s8) = G_TRUNC [[ANYEXT]](s32)
225 ; CHECK: $b0 = COPY %extract(s8)
226 ; CHECK: RET_ReallyLR implicit $b0
227 %val:_(s16) = COPY $h0
228 %extract:_(s8) = G_EXTRACT %val, 0
230 RET_ReallyLR implicit $b0
234 tracksRegLiveness: true
238 ; CHECK-LABEL: name: s1_from_s32
239 ; CHECK: liveins: $w0
240 ; CHECK: %val:_(s32) = COPY $w0
241 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
242 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY %val(s32)
243 ; CHECK: %ext:_(s32) = G_AND [[COPY]], [[C]]
244 ; CHECK: $w0 = COPY %ext(s32)
245 ; CHECK: RET_ReallyLR implicit $w0
246 %val:_(s32) = COPY $w0
247 %extract:_(s1) = G_EXTRACT %val, 0
248 %ext:_(s32) = G_ZEXT %extract
250 RET_ReallyLR implicit $w0
254 tracksRegLiveness: true
258 ; CHECK-LABEL: name: s3_from_s32
259 ; CHECK: liveins: $w0
260 ; CHECK: %val:_(s32) = COPY $w0
261 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 7
262 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY %val(s32)
263 ; CHECK: %ext:_(s32) = G_AND [[COPY]], [[C]]
264 ; CHECK: $w0 = COPY %ext(s32)
265 ; CHECK: RET_ReallyLR implicit $w0
266 %val:_(s32) = COPY $w0
267 %extract:_(s3) = G_EXTRACT %val, 0
268 %ext:_(s32) = G_ZEXT %extract
270 RET_ReallyLR implicit $w0
274 tracksRegLiveness: true
278 ; CHECK-LABEL: name: s3_from_s35
279 ; CHECK: liveins: $w0
280 ; CHECK: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
281 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY [[DEF]](s64)
282 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 7
283 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
284 ; CHECK: %ext:_(s32) = G_AND [[TRUNC]], [[C]]
285 ; CHECK: $w0 = COPY %ext(s32)
286 ; CHECK: RET_ReallyLR implicit $w0
287 %val:_(s35) = G_IMPLICIT_DEF
288 %extract:_(s3) = G_EXTRACT %val, 0
289 %ext:_(s32) = G_ZEXT %extract
291 RET_ReallyLR implicit $w0
295 tracksRegLiveness: true
299 ; CHECK-LABEL: name: s4_from_s32
300 ; CHECK: liveins: $w0
301 ; CHECK: %val:_(s32) = COPY $w0
302 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
303 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY %val(s32)
304 ; CHECK: %ext:_(s32) = G_AND [[COPY]], [[C]]
305 ; CHECK: $w0 = COPY %ext(s32)
306 ; CHECK: RET_ReallyLR implicit $w0
307 %val:_(s32) = COPY $w0
308 %extract:_(s4) = G_EXTRACT %val, 0
309 %ext:_(s32) = G_ZEXT %extract
311 RET_ReallyLR implicit $w0
315 tracksRegLiveness: true
319 ; CHECK-LABEL: name: s64_from_s264
320 ; CHECK: liveins: $x0
321 ; CHECK: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
322 ; CHECK: %extract:_(s64) = COPY [[DEF]](s64)
323 ; CHECK: $x0 = COPY %extract(s64)
324 ; CHECK: RET_ReallyLR implicit $x0
325 %val:_(s264) = G_IMPLICIT_DEF
326 %extract:_(s64) = G_EXTRACT %val, 0
328 RET_ReallyLR implicit $x0