Hi Bill,
On Mon, Feb 04, 2019 at 03:01:24PM -0600, Bill Seurer wrote:
> [PATCH, rs6000] Fix instruction counts on powerpc64 test cases.
>
> This patch fixes the assembler instruction counts for some test cases
> that started failing due to changes in code generation. The targets
> were adjusted a bit as well to avoid generating BE/LE endian code on
> unsupported platforms.
>
> Bootstrapped and tested on powerpc64le-unknown-linux-gnu (power 8 and
> power 9) and powerpc64be-unknown-linux-gnu (power 7 and power 8) with
> no regressions. Is this ok for trunk?
> Index: gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p7.c
> ===================================================================
> --- gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p7.c (revision
> 268524)
> +++ gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p7.c (working copy)
> @@ -1,28 +1,21 @@
> -/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
> +/* { dg-do compile { target { powerpc64-*-* && lp64 } } } */
> +/* Note: powerpc64-*-* is BE only. */
Target powerpc64-linux does not mean we are creating 64-bit code, or BE
for that matter; nor the other way around. It just says what the default
is.
If you want to test only when generating code for 64-bit BE targets, use
/* { dg-do compile { target { powerpc*-*-* && { lp64 && be } } } } */
But, powerpc*-*-* is guaranteed here anyway, so you can do just
/* { dg-do compile { target { lp64 && be } } } */
> -/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" }
> { "-mcpu=power7" } } */
> +/* { dg-skip-if "do not override -mcpu" { powerpc64-*-* } { "-mcpu=*" }
> { "-mcpu=power7" } } */
Don't change this please; it was correct. It could also be
/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" } {
"-mcpu=power7" } } */
(for the same reason: everything in gcc.target/powerpc is only run for
powerpc*-*-*).
> /* Expected instruction counts for Power 7 */
>
> /* { dg-final { scan-assembler-times "xvabsdp" 1 } } */
> /* { dg-final { scan-assembler-times "xvadddp" 1 } } */
> -/* { dg-final { scan-assembler-times "xxlnor" 8 { target le } } } */
> -/* { dg-final { scan-assembler-times "xxlnor" 7 { target be } } } */
> -/* { dg-final { scan-assembler-times "xvcmpeqdp" 5 { target le } } } */
> -/* { dg-final { scan-assembler-times "xvcmpeqdp" 6 { target be }} } */
> -/* { dg-final { scan-assembler-times "xvcmpeqdp." 5 { target le } } } */
> -/* { dg-final { scan-assembler-times "xvcmpeqdp." 6 { target be } } } */
> -/* { dg-final { scan-assembler-times "xvcmpgtdp" 9 { target le } } } */
> -/* { dg-final { scan-assembler-times "xvcmpgtdp" 8 { target be } } } */
> -/* { dg-final { scan-assembler-times "xvcmpgtdp." 9 { target le } } } */
> -/* { dg-final { scan-assembler-times "xvcmpgtdp." 8 { target be } } } */
> -/* { dg-final { scan-assembler-times "xvcmpgedp" 6 { target le } } } */
> -/* { dg-final { scan-assembler-times "xvcmpgedp" 7 { target be } } } */
> -/* { dg-final { scan-assembler-times "xvcmpgedp." 6 { target le } } } */
> -/* { dg-final { scan-assembler-times "xvcmpgedp." 7 { target be } } } */
> +/* { dg-final { scan-assembler-times "xxlnor" 5 } } */
> +/* { dg-final { scan-assembler-times "xvcmpeqdp" 6 } } */
> +/* { dg-final { scan-assembler-times "xvcmpeqdp." 6 } } */
> +/* { dg-final { scan-assembler-times "xvcmpgtdp" 7 } } */
> +/* { dg-final { scan-assembler-times "xvcmpgtdp." 7 } } */
> +/* { dg-final { scan-assembler-times "xvcmpgedp" 7 } } */
> +/* { dg-final { scan-assembler-times "xvcmpgedp." 7 } } */
> /* { dg-final { scan-assembler-times "xvrdpim" 1 } } */
> /* { dg-final { scan-assembler-times "xvmaddadp" 1 } } */
> /* { dg-final { scan-assembler-times "xvmsubadp" 1 } } */
Do we not want to test this on LE anymore? Oh, P7, heh. Okay. Not
enough coffee yet :-)
> +/* { dg-final { scan-assembler-times "xvcmpgedp" 6 } } */
> +/* { dg-final { scan-assembler-times "xvcmpgedp." 6 } } */
These need fixing still: both of these match
xvcmpgedp 0,1,2
because dot means "any character", in a regexp. Maybe
/* { dg-final { scan-assembler-times {\mxvcmpgedp\s} 6 } } */
/* { dg-final { scan-assembler-times {\mxvcmpgedp\.\s} 6 } } */
(and with the counts fixed). (Same for all other dot insns of course).
Segher