On Mon, 2020-04-27 at 16:00 -0400, Michael Meissner via Gcc-patches
wrote:
> This patch adds tests for -mcpu=future generating prefixed load/store
> instructions with large numeric offsets.
> 
> This is patch #5 of 7.  This patch was tested on a little endian power8 system
> running Linux, and the tests passed.  Can I check this into GCC 10?
> 
> 2020-04-27  Michael Meissner  <meiss...@linux.ibm.com>
> 
>       * gcc.target/powerpc/prefix-large.h: New set of tests to test
>       prefixed addressing on 'future' system with large numeric offsets
>       for various types.
>       * gcc.target/powerpc/prefix-large-dd.c: New test for prefixed
>       loads/stores with large offsets for the _Decimal64 type.
>       * gcc.target/powerpc/prefix-large-df.c: New test for prefixed
>       loads/stores with large offsets for the double type.
>       * gcc.target/powerpc/prefix-large-di.c: New test for prefixed
>       loads/stores with large offsets for the long type.
>       * gcc.target/powerpc/prefix-large-hi.c: New test for prefixed
>       loads/stores with large offsets for the short type.
>       * gcc.target/powerpc/prefix-large-kf.c: New test for prefixed
>       loads/stores with large offsets for the __float128 type.
>       * gcc.target/powerpc/prefix-large-qi.c: New test for prefixed
>       loads/stores with large offsets for the signed char type.
>       * gcc.target/powerpc/prefix-large-sd.c: New test for prefixed
>       loads/stores with large offsets for the _Decimal32 type.
>       * gcc.target/powerpc/prefix-large-sf.c: New test for prefixed
>       loads/stores with large offsets for the float type.
>       * gcc.target/powerpc/prefix-large-si.c: New test for prefixed
>       loads/stores with large offsets for the int type.
>       * gcc.target/powerpc/prefix-large-udi.c: New test for prefixed
>       loads/stores with large offsets for the unsigned long type.
>       * gcc.target/powerpc/prefix-large-uhi.c: New test for prefixed
>       loads/stores with large offsets for the unsigned short type.
>       * gcc.target/powerpc/prefix-large-uqi.c: New test for prefixed
>       loads/stores with large offsets for the unsigned char type.
>       * gcc.target/powerpc/prefix-large-usi.c: New test for prefixed
>       loads/stores with large offsets for the unsigned int type.
>       * gcc.target/powerpc/prefix-large-v2df.c: New test for prefixed
>       loads/stores with large offsets for the vector double type.

I'd probably drop "New" from those.  Aside from that nit, the
descriptions are good.

> 
> --- /tmp/ky2ZAZ_prefix-large-dd.c     2020-04-27 14:05:05.638417056 -0400
> +++ gcc/testsuite/gcc.target/powerpc/prefix-large-dd.c        2020-04-27 
> 14:05:05.406420175 -0400
> @@ -0,0 +1,13 @@
> +/* { dg-do compile } */
> +/* { dg-require-effective-target powerpc_prefixed_addr } */
> +/* { dg-options "-O2 -mdejagnu-cpu=future" } */
> +
> +/* Tests for prefixed instructions testing whether we can generate a prefixed
> +   load/store instruction that has a 34-bit offset for _Decimal64 objects.  
> */
> +
> +#define TYPE _Decimal64
> +
> +#include "prefix-large.h"
> +
> +/* { dg-final { scan-assembler-times {\mplfd\M}  2 } } */
> +/* { dg-final { scan-assembler-times {\mpstfd\M} 2 } } */
> --- /tmp/HDrUG4_prefix-large-df.c     2020-04-27 14:05:05.647416935 -0400
> +++ gcc/testsuite/gcc.target/powerpc/prefix-large-df.c        2020-04-27 
> 14:05:05.411420108 -0400
> @@ -0,0 +1,13 @@
> +/* { dg-do compile } */
> +/* { dg-require-effective-target powerpc_prefixed_addr } */
> +/* { dg-options "-O2 -mdejagnu-cpu=future" } */
> +
> +/* Tests for prefixed instructions testing whether we can generate a prefixed
> +   load/store instruction that has a 34-bit offset for double objects.  */
> +
> +#define TYPE double
> +
> +#include "prefix-large.h"
> +
> +/* { dg-final { scan-assembler-times {\mplfd\M}  2 } } */
> +/* { dg-final { scan-assembler-times {\mpstfd\M} 2 } } */
> 
<snip>

> --- /tmp/1H98Oa_prefix-large.h        2020-04-27 14:05:05.737415712 -0400
> +++ gcc/testsuite/gcc.target/powerpc/prefix-large.h   2020-04-27 
> 14:05:05.461419436 -0400
> @@ -0,0 +1,59 @@
> +/* Common tests for prefixed instructions testing whether we can generate a
> +   34-bit offset using 1 instruction.  */
> +
> +typedef signed char  schar;
> +typedef unsigned char        uchar;
> +typedef unsigned short       ushort;
> +typedef unsigned int uint;
> +typedef unsigned long        ulong;
> +typedef long double  ldouble;
> +typedef vector double        v2df;
> +typedef vector long  v2di;
> +typedef vector float v4sf;
> +typedef vector int   v4si;
> +
> +#ifndef TYPE
> +#define TYPE ulong
> +#endif
> +
> +#ifndef ITYPE
> +#define ITYPE TYPE
> +#endif
> +
> +#ifndef OTYPE
> +#define OTYPE TYPE
> +#endif
> +

I don't seee any users of ITYPE or OTYPE below.    Those could be
culled.   (if this is likely to be adapted in the future to include
those, probably OK?)


I didn't cross-count the scan-assembler-times stanzas, but being that
the tests are broken up into nice bite-size pieces, this seems
reasonable.

lgtm,
thanks
-Will


> +#if !defined(DO_ADD) && !defined(DO_VALUE) && !defined(DO_SET)
> +#define DO_ADD               1
> +#define DO_VALUE     1
> +#define DO_SET               1
> +#endif
> +
> +#ifndef CONSTANT
> +#define CONSTANT     0x123450UL
> +#endif
> +
> +#if DO_ADD
> +void
> +add (TYPE *p, TYPE a)
> +{
> +  p[CONSTANT] += a;
> +}
> +#endif
> +
> +#if DO_VALUE
> +OTYPE
> +value (TYPE *p)
> +{
> +  return p[CONSTANT];
> +}
> +#endif
> +
> +#if DO_SET
> +void
> +set (TYPE *p, ITYPE a)
> +{
> +  p[CONSTANT] = a;
> +}
> +#endif
> 

Reply via email to