builtins-3.c: Move built-in tests for P8 and P9 to their own test file.

2016-12-07  Carl Love  <cel@us.ibm.com>

	* gcc.target/powerpc/builtins-3.c: Move built-in tests for P8 and
	P9 to their own test file.  This allows precise constraints on the
	effective target and compile options.
	* gcc.target/powerpc/builtins-3-p8.c: New file for the vector
	compare P8 built-in tests.
	* gcc.target/powerpc/builtins-3-p9.c: New file for the vector
	compare P9 built-in tests.

From-SVN: r243370
This commit is contained in:
Carl Love 2016-12-07 16:21:16 +00:00 committed by Carl Love
parent 4dfad1fb0d
commit 27e7087f51
4 changed files with 77 additions and 43 deletions

View File

@ -1,3 +1,13 @@
2016-12-07 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/builtins-3.c: Move built-in tests for P8 and
P9 to their own test file. This allows precise constraints on the
effective target and compile options.
* gcc.target/powerpc/builtins-3-p8.c: New file for the vector
compare P8 built-in tests.
* gcc.target/powerpc/builtins-3-p9.c: New file for the vector
compare P9 built-in tests.
2016-12-07 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/pr77761.c: Require int128 effective target.

View File

@ -0,0 +1,17 @@
/* { dg-do compile } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mcpu=power8" } */
#include <altivec.h>
vector bool long long
test_eq_long_long (vector bool long long x, vector bool long long y)
{
return vec_cmpeq (x, y);
}
/* Expected test results:
test_eq_long_long 1 vcmpequd inst */
/* { dg-final { scan-assembler-times "vcmpequd" 1 } } */

View File

@ -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 } } */

View File

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-maltivec -mvsx" } */
#include <altivec.h>
@ -22,48 +22,13 @@ test_eq_int (vector bool int x, vector bool int y)
return vec_cmpeq (x, y);
}
vector bool long
test_eq_long (vector bool long x, vector bool long y)
{
return vec_cmpeq (x, y);
}
vector bool char
test_ne_char (vector bool char x, vector bool char y)
{
return vec_cmpne (x, y);
}
/* Expected test results:
vector bool short
test_ne_short (vector bool short x, vector bool short y)
{
return vec_cmpne (x, y);
}
test_eq_char 1 vcmpequb inst
test_eq_short 1 vcmpequh inst
test_eq_int 1 vcmpequw inst */
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);
}
/* Note: vec_cmpne is implemented as vcmpeq and then NOT'ed
using the xxlnor instruction.
Expected test results:
test_eq_char 1 vcmpeq inst
test_eq_short 1 vcmpeq inst
test_eq_int 1 vcmpeq inst
test_eq_long 1 vcmpeq inst
test_ne_char 1 vcmpeq, 1 xxlnor inst
test_ne_short 1 vcmpeq, 1 xxlnor inst
test_ne_int 1 vcmpeq, 1 xxlnor inst
test_ne_long 1 vcmpeq, 1 xxlnor inst */
/* { dg-final { scan-assembler-times "vcmpeq" 8 } } */
/* { dg-final { scan-assembler-times "xxlnor" 4 } } */
/* { dg-final { scan-assembler-times "vcmpequb" 1 } } */
/* { dg-final { scan-assembler-times "vcmpequh" 1 } } */
/* { dg-final { scan-assembler-times "vcmpequw" 1 } } */