https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67145
--- Comment #9 from Richard Henderson <rth at gcc dot gnu.org> --- For x86, we have one pattern, and it has things in the correct order. For aarch64, the only correct pattern is add<mode>3_carryin_alt2. The nesting and canonicalization of all the others are bogus. But powerpc is "special", using a register for the carry means that it can legitimately be sorted to any of the three input positions. Which means either creating 3 patterns, or one pattern with special matching, as Jakub suggests. That said, Alan raises some good points in #c1 that ought to be answered.