1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 define void @anyext_s64_from_s32() { ret void }
8 define void @anyext_s32_from_s8() { ret void }
10 define void @zext_s64_from_s32() { ret void }
11 define void @zext_s32_from_s16() { ret void }
12 define void @zext_s32_from_s8() { ret void }
13 define void @zext_s16_from_s8() { ret void }
15 define void @sext_s64_from_s32() { ret void }
16 define void @sext_s32_from_s16() { ret void }
17 define void @sext_s32_from_s8() { ret void }
18 define void @sext_s16_from_s8() { ret void }
22 name: anyext_s64_from_s32
27 - { id: 0, class: gpr }
28 - { id: 1, class: gpr }
34 ; CHECK-LABEL: name: anyext_s64_from_s32
35 ; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY $w0
36 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64all = SUBREG_TO_REG 0, [[COPY]], %subreg.sub_32
37 ; CHECK: $x0 = COPY [[SUBREG_TO_REG]]
44 name: anyext_s32_from_s8
49 - { id: 0, class: gpr }
50 - { id: 1, class: gpr }
56 ; CHECK-LABEL: name: anyext_s32_from_s8
57 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
58 ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[COPY]]
59 ; CHECK: $w0 = COPY [[COPY2]]
60 %2:gpr(s32) = COPY $w0
67 name: zext_s64_from_s32
72 - { id: 0, class: gpr }
73 - { id: 1, class: gpr }
79 ; CHECK-LABEL: name: zext_s64_from_s32
80 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
81 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64 = SUBREG_TO_REG 0, [[COPY]], %subreg.sub_32
82 ; CHECK: [[UBFMXri:%[0-9]+]]:gpr64 = UBFMXri [[SUBREG_TO_REG]], 0, 31
83 ; CHECK: $x0 = COPY [[UBFMXri]]
90 name: zext_s32_from_s16
95 - { id: 0, class: gpr }
96 - { id: 1, class: gpr }
102 ; CHECK-LABEL: name: zext_s32_from_s16
103 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
104 ; CHECK: [[UBFMWri:%[0-9]+]]:gpr32 = UBFMWri [[COPY]], 0, 15
105 ; CHECK: $w0 = COPY [[UBFMWri]]
106 %2:gpr(s32) = COPY $w0
113 name: zext_s32_from_s8
115 regBankSelected: true
118 - { id: 0, class: gpr }
119 - { id: 1, class: gpr }
125 ; CHECK-LABEL: name: zext_s32_from_s8
126 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
127 ; CHECK: [[UBFMWri:%[0-9]+]]:gpr32 = UBFMWri [[COPY]], 0, 15
128 ; CHECK: $w0 = COPY [[UBFMWri]]
129 %2:gpr(s32) = COPY $w0
136 name: zext_s16_from_s8
138 regBankSelected: true
141 - { id: 0, class: gpr }
142 - { id: 1, class: gpr }
148 ; CHECK-LABEL: name: zext_s16_from_s8
149 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
150 ; CHECK: [[UBFMWri:%[0-9]+]]:gpr32 = UBFMWri [[COPY]], 0, 7
151 ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[UBFMWri]]
152 ; CHECK: $w0 = COPY [[COPY2]]
153 %2:gpr(s32) = COPY $w0
156 %3:gpr(s32) = G_ANYEXT %1
161 name: sext_s64_from_s32
163 regBankSelected: true
166 - { id: 0, class: gpr }
167 - { id: 1, class: gpr }
173 ; CHECK-LABEL: name: sext_s64_from_s32
174 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
175 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64 = SUBREG_TO_REG 0, [[COPY]], %subreg.sub_32
176 ; CHECK: [[SBFMXri:%[0-9]+]]:gpr64 = SBFMXri [[SUBREG_TO_REG]], 0, 31
177 ; CHECK: $x0 = COPY [[SBFMXri]]
184 name: sext_s32_from_s16
186 regBankSelected: true
189 - { id: 0, class: gpr }
190 - { id: 1, class: gpr }
196 ; CHECK-LABEL: name: sext_s32_from_s16
197 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
198 ; CHECK: [[SBFMWri:%[0-9]+]]:gpr32 = SBFMWri [[COPY]], 0, 15
199 ; CHECK: $w0 = COPY [[SBFMWri]]
200 %2:gpr(s32) = COPY $w0
207 name: sext_s32_from_s8
209 regBankSelected: true
212 - { id: 0, class: gpr }
213 - { id: 1, class: gpr }
219 ; CHECK-LABEL: name: sext_s32_from_s8
220 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
221 ; CHECK: [[SBFMWri:%[0-9]+]]:gpr32 = SBFMWri [[COPY]], 0, 7
222 ; CHECK: $w0 = COPY [[SBFMWri]]
223 %2:gpr(s32) = COPY $w0
230 name: sext_s16_from_s8
232 regBankSelected: true
235 - { id: 0, class: gpr }
236 - { id: 1, class: gpr }
242 ; CHECK-LABEL: name: sext_s16_from_s8
243 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
244 ; CHECK: [[SBFMWri:%[0-9]+]]:gpr32 = SBFMWri [[COPY]], 0, 7
245 ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[SBFMWri]]
246 ; CHECK: $w0 = COPY [[COPY2]]
247 %2:gpr(s32) = COPY $w0
250 %3:gpr(s32) = G_ANYEXT %1