1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
5 define void @and_i32() {entry: ret void}
6 define void @and_imm() {entry: ret void}
7 define void @and_not_imm32ZExt16() {entry: ret void}
8 define void @or_i32() {entry: ret void}
9 define void @or_imm() {entry: ret void}
10 define void @or_not_imm32ZExt16() {entry: ret void}
11 define void @xor_i32() {entry: ret void}
12 define void @xor_imm() {entry: ret void}
13 define void @xor_not_imm32ZExt16() {entry: ret void}
14 define void @shl(i32) {entry: ret void}
15 define void @ashr(i32) {entry: ret void}
16 define void @lshr(i32) {entry: ret void}
17 define void @shlv(i32, i32) {entry: ret void}
18 define void @ashrv(i32, i32) {entry: ret void}
19 define void @lshrv(i32, i32) {entry: ret void}
27 tracksRegLiveness: true
32 ; MIPS32-LABEL: name: and_i32
33 ; MIPS32: liveins: $a0, $a1
34 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
35 ; MIPS32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
36 ; MIPS32: [[AND:%[0-9]+]]:gpr32 = AND [[COPY1]], [[COPY]]
37 ; MIPS32: $v0 = COPY [[AND]]
38 ; MIPS32: RetRA implicit $v0
39 %0:gprb(s32) = COPY $a0
40 %1:gprb(s32) = COPY $a1
41 %2:gprb(s32) = G_AND %1, %0
51 tracksRegLiveness: true
56 ; MIPS32-LABEL: name: and_imm
57 ; MIPS32: liveins: $a0
58 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
59 ; MIPS32: [[ANDi:%[0-9]+]]:gpr32 = ANDi [[COPY]], 255
60 ; MIPS32: $v0 = COPY [[ANDi]]
61 ; MIPS32: RetRA implicit $v0
62 %0:gprb(s32) = COPY $a0
63 %1:gprb(s32) = G_CONSTANT i32 255
64 %2:gprb(s32) = G_AND %0, %1
70 name: and_not_imm32ZExt16
74 tracksRegLiveness: true
79 ; MIPS32-LABEL: name: and_not_imm32ZExt16
80 ; MIPS32: liveins: $a0
81 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
82 ; MIPS32: [[ADDiu:%[0-9]+]]:gpr32 = ADDiu $zero, 65280
83 ; MIPS32: [[AND:%[0-9]+]]:gpr32 = AND [[COPY]], [[ADDiu]]
84 ; MIPS32: $v0 = COPY [[AND]]
85 ; MIPS32: RetRA implicit $v0
86 %0:gprb(s32) = COPY $a0
87 %1:gprb(s32) = G_CONSTANT i32 -256
88 %2:gprb(s32) = G_AND %0, %1
98 tracksRegLiveness: true
103 ; MIPS32-LABEL: name: or_i32
104 ; MIPS32: liveins: $a0, $a1
105 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
106 ; MIPS32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
107 ; MIPS32: [[OR:%[0-9]+]]:gpr32 = OR [[COPY1]], [[COPY]]
108 ; MIPS32: $v0 = COPY [[OR]]
109 ; MIPS32: RetRA implicit $v0
110 %0:gprb(s32) = COPY $a0
111 %1:gprb(s32) = COPY $a1
112 %2:gprb(s32) = G_OR %1, %0
121 regBankSelected: true
122 tracksRegLiveness: true
127 ; MIPS32-LABEL: name: or_imm
128 ; MIPS32: liveins: $a0
129 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
130 ; MIPS32: [[ORi:%[0-9]+]]:gpr32 = ORi [[COPY]], 65535
131 ; MIPS32: $v0 = COPY [[ORi]]
132 ; MIPS32: RetRA implicit $v0
133 %0:gprb(s32) = COPY $a0
134 %1:gprb(s32) = G_CONSTANT i32 65535
135 %2:gprb(s32) = G_OR %0, %1
141 name: or_not_imm32ZExt16
144 regBankSelected: true
145 tracksRegLiveness: true
150 ; MIPS32-LABEL: name: or_not_imm32ZExt16
151 ; MIPS32: liveins: $a0
152 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
153 ; MIPS32: [[LUi:%[0-9]+]]:gpr32 = LUi 1
154 ; MIPS32: [[OR:%[0-9]+]]:gpr32 = OR [[COPY]], [[LUi]]
155 ; MIPS32: $v0 = COPY [[OR]]
156 ; MIPS32: RetRA implicit $v0
157 %0:gprb(s32) = COPY $a0
158 %1:gprb(s32) = G_CONSTANT i32 65536
159 %2:gprb(s32) = G_OR %0, %1
168 regBankSelected: true
169 tracksRegLiveness: true
174 ; MIPS32-LABEL: name: xor_i32
175 ; MIPS32: liveins: $a0, $a1
176 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
177 ; MIPS32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
178 ; MIPS32: [[XOR:%[0-9]+]]:gpr32 = XOR [[COPY1]], [[COPY]]
179 ; MIPS32: $v0 = COPY [[XOR]]
180 ; MIPS32: RetRA implicit $v0
181 %0:gprb(s32) = COPY $a0
182 %1:gprb(s32) = COPY $a1
183 %2:gprb(s32) = G_XOR %1, %0
192 regBankSelected: true
193 tracksRegLiveness: true
198 ; MIPS32-LABEL: name: xor_imm
199 ; MIPS32: liveins: $a0
200 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
201 ; MIPS32: [[XORi:%[0-9]+]]:gpr32 = XORi [[COPY]], 1
202 ; MIPS32: $v0 = COPY [[XORi]]
203 ; MIPS32: RetRA implicit $v0
204 %0:gprb(s32) = COPY $a0
205 %1:gprb(s32) = G_CONSTANT i32 1
206 %2:gprb(s32) = G_XOR %0, %1
212 name: xor_not_imm32ZExt16
215 regBankSelected: true
216 tracksRegLiveness: true
221 ; MIPS32-LABEL: name: xor_not_imm32ZExt16
222 ; MIPS32: liveins: $a0
223 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
224 ; MIPS32: [[NOR:%[0-9]+]]:gpr32 = NOR [[COPY]], $zero
225 ; MIPS32: $v0 = COPY [[NOR]]
226 ; MIPS32: RetRA implicit $v0
227 %0:gprb(s32) = COPY $a0
228 %1:gprb(s32) = G_CONSTANT i32 -1
229 %2:gprb(s32) = G_XOR %0, %1
238 regBankSelected: true
239 tracksRegLiveness: true
244 ; MIPS32-LABEL: name: shl
245 ; MIPS32: liveins: $a0
246 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
247 ; MIPS32: [[SLL:%[0-9]+]]:gpr32 = SLL [[COPY]], 1
248 ; MIPS32: $v0 = COPY [[SLL]]
249 ; MIPS32: RetRA implicit $v0
250 %0:gprb(s32) = COPY $a0
251 %1:gprb(s32) = G_CONSTANT i32 1
252 %2:gprb(s32) = G_SHL %0, %1
261 regBankSelected: true
262 tracksRegLiveness: true
267 ; MIPS32-LABEL: name: ashr
268 ; MIPS32: liveins: $a0
269 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
270 ; MIPS32: [[SRA:%[0-9]+]]:gpr32 = SRA [[COPY]], 1
271 ; MIPS32: $v0 = COPY [[SRA]]
272 ; MIPS32: RetRA implicit $v0
273 %0:gprb(s32) = COPY $a0
274 %1:gprb(s32) = G_CONSTANT i32 1
275 %2:gprb(s32) = G_ASHR %0, %1
284 regBankSelected: true
285 tracksRegLiveness: true
290 ; MIPS32-LABEL: name: lshr
291 ; MIPS32: liveins: $a0
292 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
293 ; MIPS32: [[SRL:%[0-9]+]]:gpr32 = SRL [[COPY]], 1
294 ; MIPS32: $v0 = COPY [[SRL]]
295 ; MIPS32: RetRA implicit $v0
296 %0:gprb(s32) = COPY $a0
297 %1:gprb(s32) = G_CONSTANT i32 1
298 %2:gprb(s32) = G_LSHR %0, %1
307 regBankSelected: true
308 tracksRegLiveness: true
313 ; MIPS32-LABEL: name: shlv
314 ; MIPS32: liveins: $a0, $a1
315 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
316 ; MIPS32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
317 ; MIPS32: [[SLLV:%[0-9]+]]:gpr32 = SLLV [[COPY]], [[COPY1]]
318 ; MIPS32: $v0 = COPY [[SLLV]]
319 ; MIPS32: RetRA implicit $v0
320 %0:gprb(s32) = COPY $a0
321 %1:gprb(s32) = COPY $a1
322 %2:gprb(s32) = G_SHL %0, %1
331 regBankSelected: true
332 tracksRegLiveness: true
337 ; MIPS32-LABEL: name: ashrv
338 ; MIPS32: liveins: $a0, $a1
339 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
340 ; MIPS32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
341 ; MIPS32: [[SRAV:%[0-9]+]]:gpr32 = SRAV [[COPY]], [[COPY1]]
342 ; MIPS32: $v0 = COPY [[SRAV]]
343 ; MIPS32: RetRA implicit $v0
344 %0:gprb(s32) = COPY $a0
345 %1:gprb(s32) = COPY $a1
346 %2:gprb(s32) = G_ASHR %0, %1
355 regBankSelected: true
356 tracksRegLiveness: true
361 ; MIPS32-LABEL: name: lshrv
362 ; MIPS32: liveins: $a0, $a1
363 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
364 ; MIPS32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
365 ; MIPS32: [[SRLV:%[0-9]+]]:gpr32 = SRLV [[COPY]], [[COPY1]]
366 ; MIPS32: $v0 = COPY [[SRLV]]
367 ; MIPS32: RetRA implicit $v0
368 %0:gprb(s32) = COPY $a0
369 %1:gprb(s32) = COPY $a1
370 %2:gprb(s32) = G_LSHR %0, %1