1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -O0 -run-pass=instruction-select -verify-machineinstrs %s -global-isel-abort=1 -o - | FileCheck %s
11 ; CHECK-LABEL: name: shl_cimm_32
12 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
13 ; CHECK: [[UBFMWri:%[0-9]+]]:gpr32 = UBFMWri [[COPY]], 24, 23
14 ; CHECK: $w0 = COPY [[UBFMWri]]
15 ; CHECK: RET_ReallyLR implicit $w0
16 %0:gpr(s32) = COPY $w0
17 %1:gpr(s32) = G_CONSTANT i32 8
18 %2:gpr(s32) = G_SHL %0, %1(s32)
20 RET_ReallyLR implicit $w0
31 ; CHECK-LABEL: name: shl_cimm_64
32 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
33 ; CHECK: [[UBFMXri:%[0-9]+]]:gpr64 = UBFMXri [[COPY]], 56, 55
34 ; CHECK: $x0 = COPY [[UBFMXri]]
35 ; CHECK: RET_ReallyLR implicit $x0
36 %0:gpr(s64) = COPY $x0
37 %1:gpr(s64) = G_CONSTANT i64 8
38 %2:gpr(s64) = G_SHL %0, %1(s64)
40 RET_ReallyLR implicit $x0
51 ; CHECK-LABEL: name: lshr_cimm_32
52 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
53 ; CHECK: [[UBFMWri:%[0-9]+]]:gpr32 = UBFMWri [[COPY]], 8, 31
54 ; CHECK: $w0 = COPY [[UBFMWri]]
55 ; CHECK: RET_ReallyLR implicit $w0
56 %0:gpr(s32) = COPY $w0
57 %3:gpr(s64) = G_CONSTANT i64 8
58 %2:gpr(s32) = G_LSHR %0, %3(s64)
60 RET_ReallyLR implicit $w0
71 ; CHECK-LABEL: name: lshr_cimm_64
72 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
73 ; CHECK: [[UBFMXri:%[0-9]+]]:gpr64 = UBFMXri [[COPY]], 8, 63
74 ; CHECK: $x0 = COPY [[UBFMXri]]
75 ; CHECK: RET_ReallyLR implicit $x0
76 %0:gpr(s64) = COPY $x0
77 %1:gpr(s64) = G_CONSTANT i64 8
78 %2:gpr(s64) = G_LSHR %0, %1(s64)
80 RET_ReallyLR implicit $x0
91 ; CHECK-LABEL: name: ashr_cimm_32
92 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
93 ; CHECK: [[SBFMWri:%[0-9]+]]:gpr32 = SBFMWri [[COPY]], 8, 31
94 ; CHECK: $w0 = COPY [[SBFMWri]]
95 ; CHECK: RET_ReallyLR implicit $w0
96 %0:gpr(s32) = COPY $w0
97 %3:gpr(s64) = G_CONSTANT i64 8
98 %2:gpr(s32) = G_ASHR %0, %3(s64)
100 RET_ReallyLR implicit $w0
104 name: ashr_cimm_32_64
106 regBankSelected: true
111 ; CHECK-LABEL: name: ashr_cimm_32_64
112 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
113 ; CHECK: [[MOVi64imm:%[0-9]+]]:gpr64 = MOVi64imm -8
114 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[MOVi64imm]]
115 ; CHECK: [[ASRVWr:%[0-9]+]]:gpr32 = ASRVWr [[COPY]], [[COPY1]]
116 ; CHECK: $w0 = COPY [[ASRVWr]]
117 ; CHECK: RET_ReallyLR implicit $w0
118 %0:gpr(s32) = COPY $w0
119 %3:gpr(s64) = G_CONSTANT i64 -8
120 %2:gpr(s32) = G_ASHR %0, %3(s64)
122 RET_ReallyLR implicit $w0
126 name: lshr_cimm_32_64
128 regBankSelected: true
133 ; CHECK-LABEL: name: lshr_cimm_32_64
134 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
135 ; CHECK: [[MOVi64imm:%[0-9]+]]:gpr64 = MOVi64imm -8
136 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[MOVi64imm]]
137 ; CHECK: [[LSRVWr:%[0-9]+]]:gpr32 = LSRVWr [[COPY]], [[COPY1]]
138 ; CHECK: $w0 = COPY [[LSRVWr]]
139 ; CHECK: RET_ReallyLR implicit $w0
140 %0:gpr(s32) = COPY $w0
141 %3:gpr(s64) = G_CONSTANT i64 -8
142 %2:gpr(s32) = G_LSHR %0, %3(s64)
144 RET_ReallyLR implicit $w0
150 regBankSelected: true
155 ; CHECK-LABEL: name: ashr_cimm_64
156 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
157 ; CHECK: [[SBFMXri:%[0-9]+]]:gpr64 = SBFMXri [[COPY]], 8, 63
158 ; CHECK: $x0 = COPY [[SBFMXri]]
159 ; CHECK: RET_ReallyLR implicit $x0
160 %0:gpr(s64) = COPY $x0
161 %1:gpr(s64) = G_CONSTANT i64 8
162 %2:gpr(s64) = G_ASHR %0, %1(s64)
164 RET_ReallyLR implicit $x0
168 name: lshr_32_notimm64
170 regBankSelected: true
175 ; CHECK-LABEL: name: lshr_32_notimm64
176 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
177 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 8
178 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64 = SUBREG_TO_REG 0, [[MOVi32imm]], %subreg.sub_32
179 ; CHECK: [[ANDXri:%[0-9]+]]:gpr64sp = ANDXri [[SUBREG_TO_REG]], 8000
180 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[ANDXri]].sub_32
181 ; CHECK: [[LSRVWr:%[0-9]+]]:gpr32 = LSRVWr [[COPY]], [[COPY1]]
182 ; CHECK: $w0 = COPY [[LSRVWr]]
183 ; CHECK: RET_ReallyLR implicit $w0
184 %0:gpr(s32) = COPY $w0
185 %3:gpr(s64) = G_CONSTANT i64 8
186 %4:gpr(s64) = G_AND %3, %3
187 %2:gpr(s32) = G_LSHR %0, %4(s64)
189 RET_ReallyLR implicit $w0
193 name: ashr_32_notimm64
195 regBankSelected: true
200 ; CHECK-LABEL: name: ashr_32_notimm64
201 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
202 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 8
203 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64 = SUBREG_TO_REG 0, [[MOVi32imm]], %subreg.sub_32
204 ; CHECK: [[ANDXri:%[0-9]+]]:gpr64sp = ANDXri [[SUBREG_TO_REG]], 8000
205 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[ANDXri]].sub_32
206 ; CHECK: [[ASRVWr:%[0-9]+]]:gpr32 = ASRVWr [[COPY]], [[COPY1]]
207 ; CHECK: $w0 = COPY [[ASRVWr]]
208 ; CHECK: RET_ReallyLR implicit $w0
209 %0:gpr(s32) = COPY $w0
210 %3:gpr(s64) = G_CONSTANT i64 8
211 %4:gpr(s64) = G_AND %3, %3
212 %2:gpr(s32) = G_ASHR %0, %4(s64)
214 RET_ReallyLR implicit $w0