summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2015-11-01 10:19:23 +0100
committerBen Gamari <ben@smart-cactus.org>2015-11-01 10:19:24 +0100
commit9f0ecb41c288aacec43c5f736cb7aeaa469c9801 (patch)
tree7b5b4b3bbe636d18c64a507c06d9bd0f613db79f
parent184dfced1b07e1b178e98ae55f293187844b3105 (diff)
downloadhaskell-9f0ecb41c288aacec43c5f736cb7aeaa469c9801.tar.gz
ghc-prim: Fix hs_ctz64 for powerpc
Test Plan: Test on powerpc/linux Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1413
-rw-r--r--libraries/ghc-prim/cbits/ctz.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libraries/ghc-prim/cbits/ctz.c b/libraries/ghc-prim/cbits/ctz.c
index f68f628bd3..95f327a919 100644
--- a/libraries/ghc-prim/cbits/ctz.c
+++ b/libraries/ghc-prim/cbits/ctz.c
@@ -31,7 +31,7 @@ hs_ctz32(StgWord x)
StgWord
hs_ctz64(StgWord64 x)
{
-#if defined(__GNUC__) && defined(i386_HOST_ARCH)
+#if defined(__GNUC__) && (defined(i386_HOST_ARCH) || defined(powerpc_HOST_ARCH))
/* On Linux/i386, the 64bit `__builtin_ctzll()` instrinsic doesn't
get inlined by GCC but rather a short `__ctzdi2` runtime function
is inserted when needed into compiled object files.