From 53481a280fa276a7c53e1279e3a58d7e7e736064 Mon Sep 17 00:00:00 2001 From: Carl Love Date: Fri, 4 May 2018 16:17:15 +0000 Subject: [PATCH] vsx-vector-6.h (foo): Add test for vec_max, vec_trunc. gcc/testsuite/ChangeLog: 2018-05-04 Carl Love * gcc.target/powerpc/vsx-vector-6.h (foo): Add test for vec_max, vec_trunc. * gcc.target/powerpc/vsx-vector-6-le.c (dg-final): Update xvcmpeqdp, xvcmpgtdp, xvcmpgedp counts. Add xxsel counts. * gcc.target/powerpc/vsx-vector-6-be.c (dg-final): Update xvcmpgtdp, xvcmpgedp counts. Add xxsel counts. From-SVN: r259936 --- gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/gcc.target/powerpc/vsx-vector-6-be.c | 5 +++-- gcc/testsuite/gcc.target/powerpc/vsx-vector-6-le.c | 7 ++++--- gcc/testsuite/gcc.target/powerpc/vsx-vector-6.h | 14 ++++++++++++-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7bf4cad5fa8..f4de7e52a5e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2018-05-04 Carl Love + * gcc.target/powerpc/vsx-vector-6.h (foo): Add test for vec_max, + vec_trunc. + * gcc.target/powerpc/vsx-vector-6-le.c (dg-final): Update xvcmpeqdp, + xvcmpgtdp, xvcmpgedp counts. Add xxsel counts. + * gcc.target/powerpc/vsx-vector-6-be.c (dg-final): Update xvcmpgtdp, + xvcmpgedp counts. Add xxsel counts. + 2018-05-04 Richard Biener PR middle-end/85627 diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-be.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-be.c index a33f6d1de27..3305781bc6f 100644 --- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-be.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-be.c @@ -9,8 +9,8 @@ /* { dg-final { scan-assembler-times "xvadddp" 1 } } */ /* { dg-final { scan-assembler-times "xxlnor" 7 } } */ /* { dg-final { scan-assembler-times "xvcmpeqdp" 6 } } */ -/* { dg-final { scan-assembler-times "xvcmpgtdp" 7 } } */ -/* { dg-final { scan-assembler-times "xvcmpgedp" 6 } } */ +/* { dg-final { scan-assembler-times "xvcmpgtdp" 8 } } */ +/* { 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 } } */ @@ -26,6 +26,7 @@ /* { dg-final { scan-assembler-times "xvnmaddasp" 1 } } */ /* { dg-final { scan-assembler-times "vmsumshs" 1 } } */ /* { dg-final { scan-assembler-times "xxland" 13 } } */ +/* { dg-final { scan-assembler-times "xxsel" 2 } } */ /* Source code for the test in vsx-vector-6.h */ #include "vsx-vector-6.h" diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-le.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-le.c index fe7eeb12ff9..dbf87b320b9 100644 --- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-le.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-le.c @@ -14,9 +14,9 @@ their usage counts being stable. Therefore, we just ensure at least one xxlor instruction was generated. */ /* { dg-final { scan-assembler "xxlor" } } */ -/* { dg-final { scan-assembler-times "xvcmpeqdp" 5 } } */ -/* { dg-final { scan-assembler-times "xvcmpgtdp" 8 } } */ -/* { dg-final { scan-assembler-times "xvcmpgedp" 6 } } */ +/* { dg-final { scan-assembler-times "xvcmpeqdp" 4 } } */ +/* { dg-final { scan-assembler-times "xvcmpgtdp" 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 } } */ @@ -32,6 +32,7 @@ /* { dg-final { scan-assembler-times "xvnmaddasp" 1 } } */ /* { dg-final { scan-assembler-times "vmsumshs" 1 } } */ /* { dg-final { scan-assembler-times "xxland" 13 } } */ +/* { dg-final { scan-assembler-times "xxsel" 2 } } */ /* Source code for the test in vsx-vector-6.h */ #include "vsx-vector-6.h" diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.h b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.h index 422f8a1ad47..a891b64e6fa 100644 --- a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.h +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6.h @@ -7,7 +7,9 @@ void foo (vector double *out, vector double *in, vector long *p_l, vector bool long *p_b, vector unsigned char *p_uc, int *i, vector float *p_f, vector bool char *outbc, vector bool int *outbi, - vector bool short *outbsi, vector int *outsi, vector unsigned int *outui) + vector bool short *outbsi, vector int *outsi, + vector unsigned int *outui, vector signed char *outsc, + vector unsigned char *outuc) { vector double in0 = in[0]; vector double in1 = in[1]; @@ -20,6 +22,8 @@ void foo (vector double *out, vector double *in, vector long *p_l, vector bool l vector float inf0; vector float inf1; vector float inf2; + vector char inc0; + vector char inc1; vector bool char inbc0; vector bool char inbc1; vector bool short inbs0; @@ -30,6 +34,7 @@ void foo (vector double *out, vector double *in, vector long *p_l, vector bool l vector unsigned short int inusi0, inusi1; vector signed int insi0, insi1; vector unsigned int inui0, inui1; + vector unsigned char inuc0, inuc1; *out++ = vec_abs (in0); *out++ = vec_add (in0, in1); @@ -103,6 +108,7 @@ void foo (vector double *out, vector double *in, vector long *p_l, vector bool l *p_f++ = vec_nmsub (inf0, inf1, inf2); *p_f++ = vec_nmadd (inf0, inf1, inf2); *p_f++ = vec_or (inf0, inf1); + *p_f++ = vec_trunc (inf0); *out++ = vec_or (inbl0, in0); *out++ = vec_or (in0, inbl0); @@ -113,6 +119,8 @@ void foo (vector double *out, vector double *in, vector long *p_l, vector bool l *outbc++ = vec_andc (inbc0, inbc1); *outbc++ = vec_or (inbc0, inbc1); + *outuc++ = vec_max (inuc0, inuc1); + *outbi++ = vec_andc (inbi0, inbi1); *outbsi++ = vec_andc (inbs0, inbs1); @@ -151,7 +159,9 @@ int main() vector bool short *outbsi; vector int *outsi; vector unsigned int *outui; + vector signed char *outsc; + vector unsigned char *outuc; foo (out, in, p_l, p_b, p_uc, i, p_f, outbc, - outbi, outbsi, outsi, outui); + outbi, outbsi, outsi, outui, outsc, outuc); } -- 2.30.2