Skip to content

Commit 905e17b

Browse files
committed
Add unit test for half zicond lowering
1 parent e235ce4 commit 905e17b

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

llvm/test/CodeGen/RISCV/zicond-fp-select-zfinx.ll

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,48 @@ entry:
112112
%cmp = fcmp ogt double %a, %b
113113
%sel = select i1 %cmp, double %c, double %d
114114
ret double %sel
115+
}
116+
117+
; -----------------------------------------------------------------------------
118+
; half select with i1 condition (cond ? a : b), Zfinx
119+
; -----------------------------------------------------------------------------
120+
121+
define dso_local noundef half @select_half_i1(i1 %cond, half %a, half %b) nounwind {
122+
; RV64ZFINX_ZICOND-LABEL: select_half_i1:
123+
; RV64ZFINX_ZICOND: czero
124+
; RV64ZFINX_ZICOND: czero
125+
; RV64ZFINX_ZICOND: or
126+
; RV64ZFINX_ZICOND-NOT: b{{(eq|ne)z?}}
127+
; RV64ZFINX_ZICOND: ret
128+
129+
; RV64ZFINX_NOZICOND-LABEL: select_half_i1:
130+
; RV64ZFINX_NOZICOND: b{{(eq|ne)z?}}
131+
; RV64ZFINX_NOZICOND-NOT: czero.eqz
132+
; RV64ZFINX_NOZICOND-NOT: czero.nez
133+
134+
; RV64F-LABEL: select_half_i1:
135+
; RV64F: b{{(eq|ne)z?}}
136+
; RV64F-NOT: czero.eqz
137+
; RV64F-NOT: czero.nez
138+
139+
; RV32ZFINX_ZICOND-LABEL: select_half_i1:
140+
; RV32ZFINX_ZICOND: czero
141+
; RV32ZFINX_ZICOND: czero
142+
; RV32ZFINX_ZICOND: or
143+
; RV32ZFINX_ZICOND-NOT: b{{(eq|ne)z?}}
144+
; RV32ZFINX_ZICOND: ret
145+
146+
; RV32ZFINX_NOZICOND-LABEL: select_half_i1:
147+
; RV32ZFINX_NOZICOND: b{{(eq|ne)z?}}
148+
; RV32ZFINX_NOZICOND-NOT: czero.eqz
149+
; RV32ZFINX_NOZICOND-NOT: czero.nez
150+
151+
; RV32F-LABEL: select_half_i1:
152+
; RV32F: b{{(eq|ne)z?}}
153+
; RV32F-NOT: czero.eqz
154+
; RV32F-NOT: czero.nez
155+
156+
entry:
157+
%sel = select i1 %cond, half %a, half %b
158+
ret half %sel
115159
}

0 commit comments

Comments
 (0)