[commit: ghc] master: Reimplement im/export primitives for integer-gmp2 (4224466)

git at git.haskell.org git at git.haskell.org
Wed Nov 19 10:03:00 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/42244668af6d8c1dd6a2d64af90ed57d8ecd8d88/ghc

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

commit 42244668af6d8c1dd6a2d64af90ed57d8ecd8d88
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Tue Nov 18 16:52:02 2014 +0100

    Reimplement im/export primitives for integer-gmp2
    
    The import/export operations were available in `integer-gmp-0.5.1`
    already, but need to be reimplemented from scratch for the
    `integer-gmp-1.0.0` rewrite.
    
    This also adds a few more operations than were previously available for
    use w/ the `BigNat` type (which will be useful for implementing
    serialisation for the upcoming `Natural` type)
    
    Specifically, the following operations are (re)added (albeit with
    slightly different type-signatures):
    
     - `sizeInBaseBigNat`
     - `sizeInBaseInteger`
     - `sizeInBaseWord#`
    
     - `exportBigNatToAddr`
     - `exportIntegerToAddr`
     - `exportWordToAddr`
     - `exportBigNatToMutableByteArray`
     - `exportIntegerToMutableByteArray`
     - `exportWordToMutableByteArray`
    
     - `importBigNatFromAddr`
     - `importIntegerFromAddr`
     - `importBigNatFromByteArray`
     - `importIntegerFromByteArray`
    
    NOTE: The `integerGmpInternals` test-case is updated but not yet
          re-enabled as it contains tests for other primitives which aren't
          yet reimplemented.
    
    This addresses #9281
    
    Reviewed By: austin, duncan
    
    Differential Revision: https://phabricator.haskell.org/D480


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

42244668af6d8c1dd6a2d64af90ed57d8ecd8d88
 libraries/integer-gmp2/cbits/wrappers.c            | 161 +++++++++++++++++++++
 .../integer-gmp2/src/GHC/Integer/GMP/Internals.hs  | 154 ++++++++++++++++++++
 libraries/integer-gmp2/src/GHC/Integer/Type.hs     |  99 +++++++++++++
 testsuite/tests/lib/integer/integerGmpInternals.hs |  36 +++--
 4 files changed, 431 insertions(+), 19 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 42244668af6d8c1dd6a2d64af90ed57d8ecd8d88


More information about the ghc-commits mailing list