summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c')
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c43
1 files changed, 43 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 000000000..8efaeaba3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
@@ -0,0 +1,43 @@
+/* { dg-do link { target { *-*-linux* && powerpc_fprs } } } */
+/* { dg-options "-W -Wall -Wno-uninitialized -Wno-unused-but-set-variable -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);
+
+ __protected_stream_count (1, 2);
+ __protected_stream_go ();
+ __protected_stream_set (1, 0x1000, 3);
+ __protected_stream_stop (3);
+ __protected_stream_stop_all ();
+ __protected_unlimited_stream_set (3, 0x1000, 1);
+
+ return 0;
+}