https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127538
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Kyrylo Tkachov <[email protected]>: https://gcc.gnu.org/g:abcaae9e947e7de5b4dfeabd852dfb2232fefe07 commit r17-6494-gabcaae9e947e7de5b4dfeabd852dfb2232fefe07 Author: Samarth Tandale <[email protected]> Date: Tue Nov 17 10:41:02 2026 +0000 aarch64: Restore SUBS/CSEL for unsigned conditional subtraction [PR127538] For `x - (x >= q ? q : 0)`, combine forms RTL that the AArch64 backend does not recognize, leaving the compare, conditional move and subtraction as separate instructions. Add a `define_insn_and_split` pattern to match this RTL and split it into a subtraction with a condition-code update and a conditional select. The subtraction maps to SUBS, whose flags CSEL uses, producing SUBS/CSEL instead of CMP/CSEL/SUB. Tested on aarch64-unknown-linux-gnu with no regressions. gcc/ChangeLog: PR target/127538 * config/aarch64/aarch64.md (*aarch64_conditional_subtract<mode>): New pattern. gcc/testsuite/ChangeLog: * gcc.target/aarch64/pr127538.c: New test. Signed-off-by: Samarth Tandale <[email protected]>
