aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c')
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c b/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
new file mode 100644
index 00000000000..9af38884fb6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
@@ -0,0 +1,36 @@
+/* { dg-do link { target *-*-linux* } } */
+/* { dg-options "-W -Wall -mcpu=cell" } */
+/* Test some PPU intrinsics from <ppu_intrinsics.h>. */
+
+#include <ppu_intrinsics.h>
+
+int main ()
+{
+ double d, d1, d2;
+ float f, f1, f2;
+ unsigned long long ull, a, b;
+ long long ll;
+ int i;
+
+#ifdef __powerpc64__
+ ull = __rldcl (a, b, 3);
+ ull = __rldcr (a, b, 3);
+ ull = __rldic (a, 3, 4);
+ ull = __rldicl (a, 4, 5);
+ ull = __rldicr (a, 2, 3);
+ ull = __rldimi (a, b, 4, 6);
+#endif
+ ull = __rlwimi (a, b, 6, 9, 12);
+ ull = __rlwnm (a, b, 3, 5);
+ d = __fmul (d1, d2);
+ f = __fmuls (f1, f2);
+ f = __frsp (f);
+ d = __fcfid (ll);
+ d = __frsqrte (d1);
+ ll = __fctid (d);
+ ll = __fctidz (d);
+ i = __fctiw (d);
+ i = __fctiwz (d);
+
+ return 0;
+}