@@ -304,3 +304,56 @@ entry:
304
304
store volatile i32 %or , ptr %x.addr , align 4
305
305
ret i32 %and
306
306
}
307
+
308
+ define i32 @pr125954 (i32 %arg , i1 %c ) {
309
+ ; MIPS64R2-LABEL: pr125954:
310
+ ; MIPS64R2: # %bb.0:
311
+ ; MIPS64R2-NEXT: sll $1, $4, 0
312
+ ; MIPS64R2-NEXT: addiu $2, $zero, -1
313
+ ; MIPS64R2-NEXT: move $3, $1
314
+ ; MIPS64R2-NEXT: ins $3, $2, 8, 24
315
+ ; MIPS64R2-NEXT: andi $2, $1, 255
316
+ ; MIPS64R2-NEXT: sll $1, $5, 0
317
+ ; MIPS64R2-NEXT: andi $1, $1, 1
318
+ ; MIPS64R2-NEXT: jr $ra
319
+ ; MIPS64R2-NEXT: movn $2, $3, $1
320
+ ;
321
+ ; MIPS32R2-LABEL: pr125954:
322
+ ; MIPS32R2: # %bb.0:
323
+ ; MIPS32R2-NEXT: andi $2, $4, 255
324
+ ; MIPS32R2-NEXT: addiu $1, $zero, -256
325
+ ; MIPS32R2-NEXT: or $1, $2, $1
326
+ ; MIPS32R2-NEXT: andi $3, $5, 1
327
+ ; MIPS32R2-NEXT: jr $ra
328
+ ; MIPS32R2-NEXT: movn $2, $1, $3
329
+ ;
330
+ ; MIPS16-LABEL: pr125954:
331
+ ; MIPS16: # %bb.0:
332
+ ; MIPS16-NEXT: li $6, 1
333
+ ; MIPS16-NEXT: and $6, $5
334
+ ; MIPS16-NEXT: li $2, 255
335
+ ; MIPS16-NEXT: and $2, $4
336
+ ; MIPS16-NEXT: move $3, $zero
337
+ ; MIPS16-NEXT: beqz $6, $BB2_2 # 16 bit inst
338
+ ; MIPS16-NEXT: # %bb.1:
339
+ ; MIPS16-NEXT: addiu $3, -256
340
+ ; MIPS16-NEXT: or $2, $3
341
+ ; MIPS16-NEXT: $BB2_2:
342
+ ; MIPS16-NEXT: jrc $ra
343
+ ;
344
+ ; MIPS64R2N32-LABEL: pr125954:
345
+ ; MIPS64R2N32: # %bb.0:
346
+ ; MIPS64R2N32-NEXT: sll $1, $4, 0
347
+ ; MIPS64R2N32-NEXT: addiu $2, $zero, -1
348
+ ; MIPS64R2N32-NEXT: move $3, $1
349
+ ; MIPS64R2N32-NEXT: ins $3, $2, 8, 24
350
+ ; MIPS64R2N32-NEXT: andi $2, $1, 255
351
+ ; MIPS64R2N32-NEXT: sll $1, $5, 0
352
+ ; MIPS64R2N32-NEXT: andi $1, $1, 1
353
+ ; MIPS64R2N32-NEXT: jr $ra
354
+ ; MIPS64R2N32-NEXT: movn $2, $3, $1
355
+ %and = and i32 %arg , 255
356
+ %or = or i32 %and , -256
357
+ %sel = select i1 %c , i32 %or , i32 %and
358
+ ret i32 %sel
359
+ }
0 commit comments