This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v3, rs6000] Add built-in support for vector compare listed in the ABI
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: "Carl E. Love" <cel at us dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>, segher at kernel dot crashing dot org, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Mon, 02 Jan 2017 11:07:26 +0100
- Subject: Re: [PATCH v3, rs6000] Add built-in support for vector compare listed in the ABI
- Authentication-results: sourceware.org; auth=none
- References: <1481059404.4591.10.camel@us.ibm.com>
On Dez 06 2016, "Carl E. Love" <cel@us.ibm.com> wrote:
> diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c
> new file mode 100644
> index 0000000..d846e29
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c
> @@ -0,0 +1,42 @@
> +/* { dg-do compile } */
> +/* { dg-require-effective-target powerpc_p9vector_ok } */
> +/* { dg-options "-mcpu=power9" } */
> +
> +#include <altivec.h>
> +
> +vector bool char
> +test_ne_char (vector bool char x, vector bool char y)
> +{
> + return vec_cmpne (x, y);
> +}
> +
> +vector bool short
> +test_ne_short (vector bool short x, vector bool short y)
> +{
> + return vec_cmpne (x, y);
> +}
> +
> +vector bool int
> +test_ne_int (vector bool int x, vector bool int y)
> +{
> + return vec_cmpne (x, y);
> +}
> +
> +vector bool long
> +test_ne_long (vector bool long x, vector bool long y)
> +{
> + return vec_cmpne (x, y);
> +}
> +
> +/* Expected test results:
> +
> + test_ne_char 1 vcmpneb
> + test_ne_short 1 vcmpneh
> + test_ne_int 1 vcmpnew
> + test_ne_long 1 vcmpequd, 1 xxlnor inst */
> +
> +/* { dg-final { scan-assembler-times "vcmpneb" 1 } } */
> +/* { dg-final { scan-assembler-times "vcmpneh" 1 } } */
> +/* { dg-final { scan-assembler-times "vcmpnew" 1 } } */
> +/* { dg-final { scan-assembler-times "vcmpequd" 1 } } */
> +/* { dg-final { scan-assembler-times "xxlnor" 1 } } */
The last three fail with -m32.
$ grep -c vcmpnew builtins-3-p9.s
2
$ grep -c vcmpequd builtins-3-p9.s
0
$ grep -c xxlnor builtins-3-p9.s
0
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."