[commit: ghc] master: ghc-prim: Fix hs_ctz64 for powerpc (9f0ecb4)

git at git.haskell.org git at git.haskell.org
Sun Nov 1 09:47:08 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9f0ecb41c288aacec43c5f736cb7aeaa469c9801/ghc

>---------------------------------------------------------------

commit 9f0ecb41c288aacec43c5f736cb7aeaa469c9801
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Sun Nov 1 10:19:23 2015 +0100

    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


>---------------------------------------------------------------

9f0ecb41c288aacec43c5f736cb7aeaa469c9801
 libraries/ghc-prim/cbits/ctz.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libraries/ghc-prim/cbits/ctz.c b/libraries/ghc-prim/cbits/ctz.c
index f68f628..95f327a 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.



More information about the ghc-commits mailing list