diff options
author | Alexandre <alexandrer_b@outlook.com> | 2019-03-28 16:21:35 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-04-01 03:32:28 -0400 |
commit | 33173a51c77d9960d5009576ad9b67b646dfda3c (patch) | |
tree | e9a1e709cefdfdb65516323ed40fbcf3bb8cd0e4 /includes/stg | |
parent | 6f7115dfd4fbb439a309a8381c4d02c450170cdc (diff) | |
download | haskell-33173a51c77d9960d5009576ad9b67b646dfda3c.tar.gz |
Add support for bitreverse primop
This commit includes the necessary changes in code and
documentation to support a primop that reverses a word's
bits. It also includes a test.
Diffstat (limited to 'includes/stg')
-rw-r--r-- | includes/stg/Prim.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/stg/Prim.h b/includes/stg/Prim.h index ce691450a1..badbde4dfa 100644 --- a/includes/stg/Prim.h +++ b/includes/stg/Prim.h @@ -56,6 +56,14 @@ StgWord16 hs_bswap16(StgWord16 x); StgWord32 hs_bswap32(StgWord32 x); StgWord64 hs_bswap64(StgWord64 x); +/* libraries/ghc-prim/cbits/bitrev.c +This was done as part of issue #16164. +See Note [Bit reversal primop] for more details about the implementation.*/ +StgWord hs_bitrev8(StgWord x); +StgWord16 hs_bitrev16(StgWord16 x); +StgWord32 hs_bitrev32(StgWord32 x); +StgWord64 hs_bitrev64(StgWord64 x); + /* TODO: longlong.c */ /* libraries/ghc-prim/cbits/pdep.c */ |