diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-11-05 17:19:35 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@linaro.org> | 2017-11-05 17:19:35 +0000 |
commit | 648f8fc59b2cc39abd24f4c22388b346cdebcc31 (patch) | |
tree | 3a07eccc4c22b265261edd75c9ec3910d9c626f5 /gcc/testsuite/gcc.target/powerpc/sse2-check.h | |
parent | 7bef5b82e4109778a0988d20e19e1ed29dadd835 (diff) | |
parent | 8c089b5c15a7b35644750ca393f1e66071ad9aa9 (diff) | |
download | gcc-648f8fc59b2cc39abd24f4c22388b346cdebcc31.tar.gz |
Merge trunk into sve
Diffstat (limited to 'gcc/testsuite/gcc.target/powerpc/sse2-check.h')
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/sse2-check.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/powerpc/sse2-check.h b/gcc/testsuite/gcc.target/powerpc/sse2-check.h new file mode 100644 index 00000000000..beb1b7d24f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/sse2-check.h @@ -0,0 +1,52 @@ +#include <stdlib.h> + +/* Define this to enable the combination of VSX vector double and + SSE2 data types. */ +#define __VSX_SSE2__ 1 + +#include "m128-check.h" + +/* define DEBUG replace abort with printf on error. */ +//#define DEBUG 1 + +#if 1 + +#define TEST sse2_test + +static void sse2_test (void); + +static void +__attribute__ ((noinline)) +do_test (void) +{ + sse2_test (); +} + +int +main () + { +#ifdef __BUILTIN_CPU_SUPPORTS__ + /* Most SSE2 (vector double) intrinsic operations require VSX + instructions, but some operations may need only VMX + instructions. This also true for SSE2 scalar doubles as they + imply that "other half" of the vector remains unchanged or set + to zeros. The VSX scalar operations leave ther "other half" + undefined, and require additional merge operations. + Some conversions (to/from integer) need the direct register + transfer instructions from POWER8 for best performance. + So we test for arch_2_07. */ + if ( __builtin_cpu_supports ("arch_2_07") ) + { + do_test (); +#ifdef DEBUG + printf ("PASSED\n"); +#endif + } +#ifdef DEBUG + else + printf ("SKIPPED\n"); +#endif +#endif /* __BUILTIN_CPU_SUPPORTS__ */ + return 0; + } +#endif |