[committed] Fix float128-hw7.c testcase

Message ID 20180112202050.GI2063@tucnak
State New
Headers show
Series
  • [committed] Fix float128-hw7.c testcase
Related show

Commit Message

Jakub Jelinek Jan. 12, 2018, 8:20 p.m.
On Fri, Dec 29, 2017 at 12:35:03AM -0500, Michael Meissner wrote:
> 	* gcc.target/powerpc/float128-hw7.c: Likewise.

> --- gcc/testsuite/gcc.target/powerpc/float128-hw7.c	(nonexistent)
> +++ gcc/testsuite/gcc.target/powerpc/float128-hw7.c	(working copy)
> @@ -0,0 +1,27 @@
> +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
> +/* { dg-require-effective-target powerpc_p9vector_ok } */
> +/* { dg-options "-mpower9-vector -O2" } */
> +
> +extern _Float128 fabsf128 (_Float128);
> +extern _Float128 copysignf128 (_Float128, _Float128);
> +
> +/* Check copysign optimizations that are done for double are also done for
> +   _Float128.  */
> +
> +_Float128
> +cs_x_pos1 (_Float128 x)
> +{
> +  return copysignf128 (x, 1.0Q);		/* XSABSQP.  */
> +}
> +
> +_Float128 cs_x_neg2 (_Float128 x)
> +{
> +  return copysignf128 (x, -2.0Q);		/* XSNABSQP.  */
> +}
> +
> +/* { dg-final { scan-assembler-times {\mxsabsqp\M}  1 } } */
> +/* { dg-final { scan-assembler-not   {\mxsnabsqp\M} 1 } } */
> +/* { dg-final { scan-assembler-not   {\mxscpsgnqp\M}  } } */
> +/* { dg-final { scan-assembler-not   {\mlxvx\M}       } } */
> +/* { dg-final { scan-assembler-not   {\mlxv\M}        } } */
> +/* { dg-final { scan-assembler-not   {\mbl\M}         } } */

This testcase fails with a syntax error, scan-assembler-not with
2 operands would need to have target or xfail as the second operand, not 1.
Removing the 1 doesn't work, because xsnabsqp instruction is actually
emitted.  Given that the comments on the functions explicitly mention
that it expects one XSABSQP and one XSNABSQP instruction, I've changed
it to scan-assembler-times instead, tested on powerpc64le-linux and
committed as obvious to trunk.

2018-01-12  Jakub Jelinek  <jakub@redhat.com>

	* gcc.target/powerpc/float128-hw7.c: Use scan-assembler-times
	instead of scan-assembler-not for xsnabsqp.



	Jakub

Comments

Segher Boessenkool Jan. 12, 2018, 9:26 p.m. | #1
On Fri, Jan 12, 2018 at 09:20:50PM +0100, Jakub Jelinek wrote:
> On Fri, Dec 29, 2017 at 12:35:03AM -0500, Michael Meissner wrote:
> > +/* { dg-final { scan-assembler-times {\mxsabsqp\M}  1 } } */
> > +/* { dg-final { scan-assembler-not   {\mxsnabsqp\M} 1 } } */
> > +/* { dg-final { scan-assembler-not   {\mxscpsgnqp\M}  } } */
> > +/* { dg-final { scan-assembler-not   {\mlxvx\M}       } } */
> > +/* { dg-final { scan-assembler-not   {\mlxv\M}        } } */
> > +/* { dg-final { scan-assembler-not   {\mbl\M}         } } */
> 
> This testcase fails with a syntax error, scan-assembler-not with
> 2 operands would need to have target or xfail as the second operand, not 1.
> Removing the 1 doesn't work, because xsnabsqp instruction is actually
> emitted.  Given that the comments on the functions explicitly mention
> that it expects one XSABSQP and one XSNABSQP instruction, I've changed
> it to scan-assembler-times instead, tested on powerpc64le-linux and
> committed as obvious to trunk.

Thanks!


Segher

Patch

--- gcc/testsuite/gcc.target/powerpc/float128-hw7.c.jj	2018-01-12 18:14:53.714091910 +0000
+++ gcc/testsuite/gcc.target/powerpc/float128-hw7.c	2018-01-12 20:13:43.706918034 +0000
@@ -20,7 +20,7 @@  _Float128 cs_x_neg2 (_Float128 x)
 }
 
 /* { dg-final { scan-assembler-times {\mxsabsqp\M}  1 } } */
-/* { dg-final { scan-assembler-not   {\mxsnabsqp\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mxsnabsqp\M} 1 } } */
 /* { dg-final { scan-assembler-not   {\mxscpsgnqp\M}  } } */
 /* { dg-final { scan-assembler-not   {\mlxvx\M}       } } */
 /* { dg-final { scan-assembler-not   {\mlxv\M}        } } */