On 7/19/23 04:11, Xiao Zeng wrote: > This patch completes the recognition of the basic semantics > defined in the spec, namely: > > Conditional zero, if condition is equal to zero > rd = (rs2 == 0) ? 0 : rs1 > Conditional zero, if condition is non zero > rd = (rs2 != 0) ? 0 : rs1 > > gcc/ChangeLog: > > * config/riscv/riscv.md: Include zicond.md > * config/riscv/zicond.md: New file. > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/zicond-primitiveSemantics.c: New test. So as I mentioned earlier today, adjusting the insn condition to use rtx_equal_p seems to be the right way to go. Attached is a V2 of this patch that implements that. It was trivial enough to do that there's no need to break this patch down further. I've pushed V2 to the trunk. Thanks, Jeff