diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/powerpc/altivec-cell-1.c')
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/altivec-cell-1.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-cell-1.c b/gcc/testsuite/gcc.target/powerpc/altivec-cell-1.c new file mode 100644 index 000000000..20d29bf05 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/altivec-cell-1.c @@ -0,0 +1,34 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec" } */ + +/* Basic test for the new VMX intrinsics. */ +#include <altivec.h> + +int f(vector int a, int b) +{ + return vec_extract (a, b); +} +short f1(vector short a, int b) +{ + return vec_extract (a, b); +} +vector short f2(vector short a, int b) +{ + return vec_insert (b, a, b); +} +vector float f3(vector float a, int b) +{ + return vec_insert (b, a, b); +} + +float g(void); + +vector float f4(float b, int t) +{ + return vec_promote (g(), t); +} +vector float f5(float b) +{ + return vec_splats (g()); +} |