diff options
author | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-02 00:35:00 +0000 |
---|---|---|
committer | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-02 00:35:00 +0000 |
commit | 33c6ff0f4f4f35d7dae7bcdac8d429ab312e2b5e (patch) | |
tree | 89947b04b5c2fbd530076237357ede702d3d6c22 /gcc/testsuite/gcc.apple/ppc_intrinsics-2.c | |
parent | 0fcc981fa6eb41869dce802e289b012f4c3726be (diff) |
This commit was manufactured by cvs2svn to create tagapple/gcc-5208
'apple-gcc-5208'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/apple-gcc-5208@101526 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.apple/ppc_intrinsics-2.c')
-rw-r--r-- | gcc/testsuite/gcc.apple/ppc_intrinsics-2.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.apple/ppc_intrinsics-2.c b/gcc/testsuite/gcc.apple/ppc_intrinsics-2.c new file mode 100644 index 00000000000..2f5698fc685 --- /dev/null +++ b/gcc/testsuite/gcc.apple/ppc_intrinsics-2.c @@ -0,0 +1,66 @@ +/* { dg-options "-I ${srcdir}/../../more-hdrs -Wshorten-64-to-32 -Wno-long-long" } */ +/* { dg-do run { target "powerpc*-*-darwin*" } } */ +#include "ppc_intrinsics.h" +#include <stdlib.h> + +int main( void ) +{ + int intconst = 0x5; + long long longlongconst = 0x5; + int intloc, intloc1, intloc2; + unsigned int uintloc, uintloc1, uintloc2; + long longloc; + long long longlongloc; + int fails = 0; + + intloc = __cntlzw(intconst); + if (intloc != 29) + ++fails; + + longlongloc = __cntlzd(longlongconst); + if (longlongloc != 61) + ++fails; + + intloc = 0xffff; + __rlwimi(intloc, 0x21876543, 8, 0, 23); + if (intloc != 0x876543ff) + ++fails; + + intloc = __rlwinm(0x21876543, 8, 0, 31); + if (intloc != 0x87654321) + ++fails; + + longloc = __rlwinm(0x45, 5, 24, 31); + if (longloc != 0xa0) + ++fails; + + longloc = __rlwnm(0x47, 5, 24, 31); + if (longloc != 0xe0) + ++fails; + + intloc1 = 1 << 20; + intloc2 = 1 << 21; + intloc = __mulhw (intloc1, intloc2); + if (intloc != (1 << 9)) + ++fails; + + intloc1 = 0xfffe0000; + intloc2 = 0xfffc0000; + intloc = __mulhw (intloc1, intloc2); + if (intloc != 8) + ++fails; + + uintloc1 = 0xffffffff; + uintloc2 = 0xfffffffe; + uintloc = __mulhwu (uintloc1, uintloc2); + if (uintloc != 0xfffffffd) + ++fails; + + uintloc1 = 0xfffe0000; + uintloc2 = 0xfffc0000; + uintloc = __mulhwu (uintloc1, uintloc2); + if (uintloc != 0xfffa0008) + ++fails; + + return fails; +} |