[commit: packages/integer-gmp] master: Add primitives to write/read Integers to/from bytearrays (e94799c)
git at git.haskell.org
git at git.haskell.org
Tue Nov 5 12:42:58 UTC 2013
Repository : ssh://git@git.haskell.org/integer-gmp
On branch : master
Link : http://git.haskell.org/packages/integer-gmp.git/commitdiff/e94799c9d5e15fc03bc226197b00b1d4b1189945
>---------------------------------------------------------------
commit e94799c9d5e15fc03bc226197b00b1d4b1189945
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Tue Nov 5 12:08:00 2013 +0100
Add primitives to write/read Integers to/from bytearrays
This adds the following new (internal) primitives
{{{#!hs
sizeInBaseInteger :: Integer -> Int# -> Word#
exportInteger :: Integer -> MutableByteArray# s -> Word# -> Int#
-> State# s -> (# State# s, Word# #)
importInteger :: ByteArray# -> Word# -> Word# -> Int# -> Integer
}}}
The import/export primitives support selecting most/least significant
byte first order as well as using an offset into the byte-arrays.
See Haddock comments for more details.
Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org>
>---------------------------------------------------------------
e94799c9d5e15fc03bc226197b00b1d4b1189945
GHC/Integer/GMP/Internals.hs | 2 +-
GHC/Integer/GMP/Prim.hs | 19 +++++++++++
GHC/Integer/Type.lhs | 73 +++++++++++++++++++++++++++++++++++++++++-
cbits/gmp-wrappers.cmm | 50 +++++++++++++++++++++++++++++
4 files changed, 142 insertions(+), 2 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e94799c9d5e15fc03bc226197b00b1d4b1189945
More information about the ghc-commits
mailing list