From 083c17f86dcf13fc344667432b59c96bf2b63dcb Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Wed, 21 Oct 2020 12:24:00 -0400 Subject: [PATCH] testsuite: Enable p9-lxvx-stxvx testcases and fold-vec-extract This patch enables the p9-lxvx-stxvx testcases with appropriate requirements. It also adjusts the expected matching instructions in the fold-vec-extract testcases for BE. gcc/testsuite/ChangeLog: * gcc.target/powerpc/fold-vec-extract-float.p9.c: rldicl and subfic only for target LE. * gcc.target/powerpc/fold-vec-extract-longlong.p9.c: xori only for target LE. Adjust mfvsrd and add mfvsrld for BE. * gcc.target/powerpc/fold-vec-extract-short.p9.c: vextuhrx for LE. vextuhlx for BE. * gcc.target/powerpc/p9-lxvx-stxvx-1.c: Remove target. * gcc.target/powerpc/p9-lxvx-stxvx-2.c: Remove target. * gcc.target/powerpc/p9-lxvx-stxvx-3.c: Remove target. Require float128 --- .../gcc.target/powerpc/fold-vec-extract-float.p9.c | 4 ++-- .../gcc.target/powerpc/fold-vec-extract-longlong.p9.c | 8 +++++--- .../gcc.target/powerpc/fold-vec-extract-short.p9.c | 7 ++++--- gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-1.c | 2 +- gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-2.c | 2 +- gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-3.c | 3 ++- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p9.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p9.c index 1acd477ebd6..aaa8a92b162 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p9.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p9.c @@ -6,8 +6,8 @@ /* { dg-options "-mdejagnu-cpu=power9 -O2 " } */ /* { dg-final { scan-assembler-times {\mxscvspdp\M} 2 } } */ -/* { dg-final { scan-assembler-times {\mrldicl\M} 1 } } */ -/* { dg-final { scan-assembler-times {\msubfic\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mrldicl\M} 1 { target le } } } */ +/* { dg-final { scan-assembler-times {\msubfic\M} 1 { target le } } } */ /* { dg-final { scan-assembler-times {\msldi\M} 1 } } */ /* { dg-final { scan-assembler-times {\mmtvsrdd\M} 1 } } */ /* { dg-final { scan-assembler-times {\mvslo\M} 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p9.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p9.c index e7e1c564802..29814ed13db 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p9.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-longlong.p9.c @@ -1,5 +1,5 @@ /* Verify that overloaded built-ins for vec_extract() with long long - inputs produce the right code for a P9 (LE) target. */ + inputs produce the right code for a P9 target. */ /* { dg-do compile { target lp64 } } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ @@ -10,11 +10,13 @@ // p9 vars: xori, rldic, mtvsrdd, vslo, mfvsrd /* results. */ -/* { dg-final { scan-assembler-times {\mxori\M} 3 } } */ +/* { dg-final { scan-assembler-times {\mxori\M} 3 { target le } } } */ /* { dg-final { scan-assembler-times {\mrldic\M} 3 } } */ /* { dg-final { scan-assembler-times {\mmtvsrdd\M} 3 } } */ /* { dg-final { scan-assembler-times {\mvslo\M} 3 } } */ -/* { dg-final { scan-assembler-times {\mmfvsrd\M} 6 } } */ +/* { dg-final { scan-assembler-times {\mmfvsrd\M} 6 { target le } } } */ +/* { dg-final { scan-assembler-times {\mmfvsrd\M} 3 { target be } } } */ +/* { dg-final { scan-assembler-times {\mmfvsrld\M} 3 { target be } } } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-short.p9.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-short.p9.c index 5651986bd0c..fac35cb792f 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-short.p9.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-short.p9.c @@ -1,17 +1,18 @@ /* Verify that overloaded built-ins for vec_extract() with short - inputs produce the right code for a P9 (LE) target. */ + inputs produce the right code for a P9 target. */ /* { dg-do compile { target lp64 } } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mdejagnu-cpu=power9 -O2" } */ -// six tests total. Targeting P9 LE. +// six tests total. Targeting P9. // p9 (le) variable offset: slwi, vextuhlx, extsh // p9 (le) const offset: li, vextuhlx, extsh /* { dg-final { scan-assembler-times {\mslwi\M} 3 } } */ /* { dg-final { scan-assembler-times {\mli\M} 3 } } */ -/* { dg-final { scan-assembler-times "vextuhrx" 6 } } */ +/* { dg-final { scan-assembler-times "vextuhrx" 6 { target le } } } */ +/* { dg-final { scan-assembler-times "vextuhlx" 6 { target be } } } */ /* { dg-final { scan-assembler-times {\mextsh\M} 2 } } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-1.c b/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-1.c index e302f7196d3..553942907b6 100644 --- a/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-1.c +++ b/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { powerpc64le-*-* } } } */ +/* { dg-do compile } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mdejagnu-cpu=power9 -O3" } */ /* { dg-final { scan-assembler "lxvx" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-2.c b/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-2.c index 0da44eb49f9..edab6164814 100644 --- a/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-2.c +++ b/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-2.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { powerpc64le-*-* } } } */ +/* { dg-do compile } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mdejagnu-cpu=power9 -O1" } */ /* { dg-final { scan-assembler "lxvx" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-3.c b/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-3.c index 6d64a1ba42b..3cb28ee5b2a 100644 --- a/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-3.c +++ b/gcc/testsuite/gcc.target/powerpc/p9-lxvx-stxvx-3.c @@ -1,4 +1,5 @@ -/* { dg-do compile { target { powerpc64le-*-* } } } */ +/* { dg-do compile } */ +/* { dg-require-effective-target ppc_float128_sw } */ /* { dg-options "-mdejagnu-cpu=power9 -O3 -mfloat128" } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-final { scan-assembler "lxvx" } } */ -- 2.30.2