PR 102935, Fix pr101384-1.c code generation test.

Message ID Ydjb3YTMf84apwLa@toto.the-meissners.org
State Committed
Commit 18d88d11973c63bda4e586b979b71d48c1d9b78a
Headers
Series PR 102935, Fix pr101384-1.c code generation test. |

Commit Message

Michael Meissner Jan. 8, 2022, 12:33 a.m. UTC
  Fix pr101384-1.c code generation test.

Add support for the compiler using XXSPLTIB reg,255 to load all 1's into a
register on power9 and above instead of using VSPLTI{B,H,W} reg,-1.

gcc/testsuite/
2022-01-07  Michael Meissner  <meissner@the-meissners.org>

	PR testsuite/102935
	* gcc.target/powerpc/pr101384-1.c: Update insn regexp for power9
	and power10.
---
 gcc/testsuite/gcc.target/powerpc/pr101384-1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Li, Pan2 via Gcc-patches Jan. 11, 2022, 5:06 p.m. UTC | #1
Hi Mike,

This looks fine to me.  Maintainers?

Thanks,
Bill

On 1/7/22 6:33 PM, Michael Meissner wrote:
> Fix pr101384-1.c code generation test.
>
> Add support for the compiler using XXSPLTIB reg,255 to load all 1's into a
> register on power9 and above instead of using VSPLTI{B,H,W} reg,-1.
>
> gcc/testsuite/
> 2022-01-07  Michael Meissner  <meissner@the-meissners.org>
>
> 	PR testsuite/102935
> 	* gcc.target/powerpc/pr101384-1.c: Update insn regexp for power9
> 	and power10.
> ---
>  gcc/testsuite/gcc.target/powerpc/pr101384-1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr101384-1.c b/gcc/testsuite/gcc.target/powerpc/pr101384-1.c
> index 627d7d76721..41cf84bf8bc 100644
> --- a/gcc/testsuite/gcc.target/powerpc/pr101384-1.c
> +++ b/gcc/testsuite/gcc.target/powerpc/pr101384-1.c
> @@ -2,7 +2,7 @@
>  /* { dg-do compile { target le } } */
>  /* { dg-options "-O2 -maltivec" } */
>  /* { dg-require-effective-target powerpc_altivec_ok } */
> -/* { dg-final { scan-assembler-times {\mvspltis[whb] [^\n\r]*,-1\M} 9 } } */
> +/* { dg-final { scan-assembler-times {\mvspltis[whb] [^\n\r]*,-1\M|\mxxspltib[^\n\r]*,255\M} 9 } } */
>  /* { dg-final { scan-assembler-times {\mvslw\M} 3 } } */
>  /* { dg-final { scan-assembler-times {\mvslh\M} 3 } } */
>  /* { dg-final { scan-assembler-times {\mvslb\M} 3 } } */
  
David Edelsohn Jan. 11, 2022, 6:23 p.m. UTC | #2
On Tue, Jan 11, 2022 at 12:06 PM Bill Schmidt <wschmidt@linux.ibm.com> wrote:
>
> Hi Mike,
>
> This looks fine to me.  Maintainers?

Okay.

Thanks, David

>
> Thanks,
> Bill
>
> On 1/7/22 6:33 PM, Michael Meissner wrote:
> > Fix pr101384-1.c code generation test.
> >
> > Add support for the compiler using XXSPLTIB reg,255 to load all 1's into a
> > register on power9 and above instead of using VSPLTI{B,H,W} reg,-1.
> >
> > gcc/testsuite/
> > 2022-01-07  Michael Meissner  <meissner@the-meissners.org>
> >
> >       PR testsuite/102935
> >       * gcc.target/powerpc/pr101384-1.c: Update insn regexp for power9
> >       and power10.
> > ---
> >  gcc/testsuite/gcc.target/powerpc/pr101384-1.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/gcc/testsuite/gcc.target/powerpc/pr101384-1.c b/gcc/testsuite/gcc.target/powerpc/pr101384-1.c
> > index 627d7d76721..41cf84bf8bc 100644
> > --- a/gcc/testsuite/gcc.target/powerpc/pr101384-1.c
> > +++ b/gcc/testsuite/gcc.target/powerpc/pr101384-1.c
> > @@ -2,7 +2,7 @@
> >  /* { dg-do compile { target le } } */
> >  /* { dg-options "-O2 -maltivec" } */
> >  /* { dg-require-effective-target powerpc_altivec_ok } */
> > -/* { dg-final { scan-assembler-times {\mvspltis[whb] [^\n\r]*,-1\M} 9 } } */
> > +/* { dg-final { scan-assembler-times {\mvspltis[whb] [^\n\r]*,-1\M|\mxxspltib[^\n\r]*,255\M} 9 } } */
> >  /* { dg-final { scan-assembler-times {\mvslw\M} 3 } } */
> >  /* { dg-final { scan-assembler-times {\mvslh\M} 3 } } */
> >  /* { dg-final { scan-assembler-times {\mvslb\M} 3 } } */
  

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/pr101384-1.c b/gcc/testsuite/gcc.target/powerpc/pr101384-1.c
index 627d7d76721..41cf84bf8bc 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr101384-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr101384-1.c
@@ -2,7 +2,7 @@ 
 /* { dg-do compile { target le } } */
 /* { dg-options "-O2 -maltivec" } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-final { scan-assembler-times {\mvspltis[whb] [^\n\r]*,-1\M} 9 } } */
+/* { dg-final { scan-assembler-times {\mvspltis[whb] [^\n\r]*,-1\M|\mxxspltib[^\n\r]*,255\M} 9 } } */
 /* { dg-final { scan-assembler-times {\mvslw\M} 3 } } */
 /* { dg-final { scan-assembler-times {\mvslh\M} 3 } } */
 /* { dg-final { scan-assembler-times {\mvslb\M} 3 } } */