https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126245
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Naveen H.S <[email protected]>: https://gcc.gnu.org/g:ec09d7005033eb1f28304af80d888b81bb3063c7 commit r17-4707-gec09d7005033eb1f28304af80d888b81bb3063c7 Author: Naveen <[email protected]> Date: Sun Sep 27 21:29:20 2026 -0700 RISC-V: Add conditional negate expansion [PR126245] Add a neg<mode>cc expansion for integral comparisons on RISC-V. The expansion implements: X ? -X : X as: CMP = condition ? 1 : 0 MASK = -CMP RESULT = X ^ MASK RESULT += CMP This pattern can be used by existing if-conversion paths. Use a separate pseudo for the XOR result so that the output pseudo is assigned only once. gcc/ChangeLog: PR target/126245 * config/riscv/riscv.md (neg<mode>cc): Add an expansion for conditional negation of integral values. gcc/testsuite/ChangeLog: PR target/126245 * gcc.target/riscv/pr126245-negcc.c: New test. Signed-off-by: Naveen <[email protected]>
