Re: [PATCH take #2] PR target/43892: Some carry flag (CA) optimizations on PowerPC.

2021-12-14 Thread Segher Boessenkool
Hi! On Fri, Dec 03, 2021 at 07:42:52PM -, Roger Sayle wrote: > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/addcmp.c > @@ -0,0 +1,12 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2" } */ > + > +unsigned long add_leu(unsigned long a, unsigned long b, unsigned long c) { > +

Re: [PATCH take #2] PR target/43892: Some carry flag (CA) optimizations on PowerPC.

2021-12-14 Thread David Edelsohn via Gcc-patches
Hi, Roger! Thanks very much for investigating this issue and developing a patch to leverage this feature of the PowerPC architecture. 2021-12-03 Roger Sayle gcc/ChangeLog PR target/43892 * config/rs6000/rs6000.md (*add3_carry_in_0_2): New define_insn to recognize

[PATCH take #2] PR target/43892: Some carry flag (CA) optimizations on PowerPC.

2021-12-03 Thread Roger Sayle
Doh! This time with the patch attached... This patch resolves PR target/43892 (suboptimal add with carry) by adding four new define_insn_and_split to the rs6000 backend, that all recognize pairs of instructions where the first instruction sets the carry flag and the second one consumes it. It