Skip to content

Commit d3a92e9

Browse files
committed
Pre-commit test
1 parent 352215c commit d3a92e9

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

llvm/test/CodeGen/RISCV/xqcibm-insert.ll

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ define i32 @test_insbi_mask(i32 %a) nounwind {
4747
ret i32 %or
4848
}
4949

50+
define i32 @test_insbi_mask_mv(i32 %a, i32 %b) nounwind {
51+
; RV32I-LABEL: test_insbi_mask_mv:
52+
; RV32I: # %bb.0:
53+
; RV32I-NEXT: lui a0, 16
54+
; RV32I-NEXT: addi a0, a0, -1
55+
; RV32I-NEXT: or a0, a1, a0
56+
; RV32I-NEXT: ret
57+
;
58+
; RV32IXQCIBM-LABEL: test_insbi_mask_mv:
59+
; RV32IXQCIBM: # %bb.0:
60+
; RV32IXQCIBM-NEXT: qc.insbi a0, -1, 16, 0
61+
; RV32IXQCIBM-NEXT: ret
62+
;
63+
; RV32IXQCIBMZBS-LABEL: test_insbi_mask_mv:
64+
; RV32IXQCIBMZBS: # %bb.0:
65+
; RV32IXQCIBMZBS-NEXT: qc.insbi a0, -1, 16, 0
66+
; RV32IXQCIBMZBS-NEXT: ret
67+
%or = or i32 %b, 65535
68+
ret i32 %or
69+
}
70+
5071
define i32 @test_insbi_shifted_mask(i32 %a) nounwind {
5172
; RV32I-LABEL: test_insbi_shifted_mask:
5273
; RV32I: # %bb.0:
@@ -67,6 +88,34 @@ define i32 @test_insbi_shifted_mask(i32 %a) nounwind {
6788
ret i32 %or
6889
}
6990

91+
define i32 @test_insbi_shifted_mask_multiple_uses(i32 %a) nounwind {
92+
; RV32I-LABEL: test_insbi_shifted_mask_multiple_uses:
93+
; RV32I: # %bb.0:
94+
; RV32I-NEXT: lui a1, 15
95+
; RV32I-NEXT: or a1, a0, a1
96+
; RV32I-NEXT: addi a0, a0, 10
97+
; RV32I-NEXT: xor a0, a1, a0
98+
; RV32I-NEXT: ret
99+
;
100+
; RV32IXQCIBM-LABEL: test_insbi_shifted_mask_multiple_uses:
101+
; RV32IXQCIBM: # %bb.0:
102+
; RV32IXQCIBM-NEXT: qc.insbi a1, -1, 4, 12
103+
; RV32IXQCIBM-NEXT: addi a0, a0, 10
104+
; RV32IXQCIBM-NEXT: xor a0, a0, a1
105+
; RV32IXQCIBM-NEXT: ret
106+
;
107+
; RV32IXQCIBMZBS-LABEL: test_insbi_shifted_mask_multiple_uses:
108+
; RV32IXQCIBMZBS: # %bb.0:
109+
; RV32IXQCIBMZBS-NEXT: qc.insbi a1, -1, 4, 12
110+
; RV32IXQCIBMZBS-NEXT: addi a0, a0, 10
111+
; RV32IXQCIBMZBS-NEXT: xor a0, a0, a1
112+
; RV32IXQCIBMZBS-NEXT: ret
113+
%or = or i32 %a, 61440
114+
%add = add i32 %a, 10
115+
%xor = xor i32 %or, %add
116+
ret i32 %xor
117+
}
118+
70119
define i32 @test_single_bit_set(i32 %a) nounwind {
71120
; RV32I-LABEL: test_single_bit_set:
72121
; RV32I: # %bb.0:

0 commit comments

Comments
 (0)