Hi!

On Fri, Dec 03, 2021 at 07:42:52PM -0000, 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) {
> +  return a + (b <= c);
> +}
> +
> +unsigned long add_geu(unsigned long a, unsigned long b, unsigned long c) {
> +  return a + (b >= c);
> +}
> +
> +/* { dg-final { scan-assembler-times "addze " 2 } } */

Does this work with -mcpu=power10 after your patch?  (It doesn't before
it :-) )

> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pr43892.c
> @@ -0,0 +1,11 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2" } */
> +unsigned long foo(unsigned long sum, unsigned long x)
> +{
> +  unsigned long z = sum + x;
> +  if (sum + x < x)
> +    z++;
> +  return z;
> +}
> +
> +/* { dg-final { scan-assembler "addze " } } */

Same question here.

Thanks!


Segher

Reply via email to