Skip to content

Commit 83f1b12

Browse files
committed
Pre-commit tests
1 parent 8edb5b4 commit 83f1b12

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

llvm/test/CodeGen/RISCV/and-negpow2-cmp.ll

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,39 @@ define i1 @test4(i64 %x) {
6464
%b = icmp eq i64 %a, 0
6565
ret i1 %b
6666
}
67+
68+
define i1 @test5(i64 %x) {
69+
; RV32-LABEL: test5:
70+
; RV32: # %bb.0:
71+
; RV32-NEXT: srli a0, a0, 29
72+
; RV32-NEXT: seqz a0, a0
73+
; RV32-NEXT: ret
74+
;
75+
; RV64-LABEL: test5:
76+
; RV64: # %bb.0:
77+
; RV64-NEXT: srliw a0, a0, 29
78+
; RV64-NEXT: slli a0, a0, 29
79+
; RV64-NEXT: seqz a0, a0
80+
; RV64-NEXT: ret
81+
%a = and i64 %x, u0xE0000000
82+
%b = icmp eq i64 %a, 0
83+
ret i1 %b
84+
}
85+
86+
define i1 @test6(i64 %x) {
87+
; RV32-LABEL: test6:
88+
; RV32: # %bb.0:
89+
; RV32-NEXT: srli a0, a0, 29
90+
; RV32-NEXT: snez a0, a0
91+
; RV32-NEXT: ret
92+
;
93+
; RV64-LABEL: test6:
94+
; RV64: # %bb.0:
95+
; RV64-NEXT: srliw a0, a0, 29
96+
; RV64-NEXT: slli a0, a0, 29
97+
; RV64-NEXT: snez a0, a0
98+
; RV64-NEXT: ret
99+
%a = and i64 %x, u0xE0000000
100+
%b = icmp ne i64 %a, 0
101+
ret i1 %b
102+
}

0 commit comments

Comments
 (0)