GHC

lp:~ghc/ghc/packages-integer-gmp-master

Created by Edward Z. Yang and last modified
Get this branch:
bzr branch lp:~ghc/ghc/packages-integer-gmp-master

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
GHC HQ
Project:
GHC
Status:
Development

Import details

Import Status: Failed

This branch is an import of the HEAD branch of the Git repository at git://git.haskell.org/packages/integer-gmp.git.

The import has been suspended because it failed 5 or more times in succession.

Last successful import was .

Import started on alnitak and finished taking 2 minutes — see the log
Import started on alnitak and finished taking 15 seconds — see the log
Import started on alnitak and finished taking 2 minutes — see the log
Import started on alnitak and finished taking 2 minutes — see the log

Recent revisions

181. By Austin Seipp <email address hidden>

Fix GMP v4 compatibility.

We had started relying on GMP 5.x (for usage of mpz_powm_sec), but this
is pretty painful on RHEL-esque targets, which still use GMP 4.x.

In the mean time while we're still supporting this, it's easier to just
fallback to mpz_powm when _sec is unavailable, and emit a WARNING for
using the primitive.

This also installs a header, HsIntegerGmp.h, which clients could use for
a fallback.

As a side note, this will probably also help Debian oldstable users who
might have outdated GMP versions (which I believe is the cause for #8666.)

Reviewed-by: Herbert Valerio Riedel <email address hidden>
Signed-off-by: Austin Seipp <email address hidden>

180. By Herbert V. Riedel

Fix negation of `divMod`/`quotRem` results (fixes #8726)

High-level pseudo code of what the code was supposed to implement:

    quotRem' :: Integer -> Integer -> (Integer,Integer)
    quotRem' a b@(S# _)
      | b < 0 = negFst . uncurry quotRem' . negSnd $ (a,b)
      | otherwise = quotRemUI a (fromIntegral (abs b))

    divMod' :: Integer -> Integer -> (Integer,Integer)
    divMod' a b@(S# _)
      | b < 0 = negSnd . uncurry divMod' . negBoth $ (a,b)
      | otherwise = divModUI a (fromIntegral b)

    negFst (q,r) = (-q,r)
    negSnd (q,r) = ( q,-r)
    negBoth (q,r) = (-q,-r)

    -- quotRemUI and divModUI represent GMP's `mpz_{f,t}div_qr_ui()`
    quotRemUI, divModUI :: Integer -> Word -> (Integer,Integer)

Signed-off-by: Herbert Valerio Riedel <email address hidden>

179. By heisenbug

Fix a popular typo

Herbert, this is a merge candidate to the 7.8 branch

178. By Herbert V. Riedel

Add Hackage-supported `changelog.md`

Signed-off-by: Herbert Valerio Riedel <email address hidden>

177. By Herbert V. Riedel

Improve documentation of `integer-gmp`

Among other things, this unhides `GHC.Integer` and re-groups the export list.
Moreover, the internal representation of `Integer` is explained a bit more,
and `/Since: 0.5.1.0/` annotations have been added.

Signed-off-by: Herbert Valerio Riedel <email address hidden>

176. By Herbert V. Riedel

Dont use big/small-int primops on IL32P64 (i.e. Win/x86_64) for now

This is due to `mpz_*()` functions having @long@ arguments which are
32bit on IL32P64, whereas `Int#` and `Word#` are 64bit wide, causing all
sorts of malfunction due to truncation.

This affects mostly the new big/small-int primops introduced in the
course of #8647, so when `SIZEOF_W != SIZEOF_LONG` we simply fall back
to using the big/big-int primops. big/small primops implemented via the
low-level `mpn_*()` GMP operations are not affected, as those use
`mp_limb_t` arguments.

Signed-off-by: Herbert Valerio Riedel <email address hidden>

175. By Herbert V. Riedel

Introduce new SIZEOF_MP_LIMB_T derived constant

This allows to simplify code in `float.c` and to encode the
"sizeof(mp_limb_t) != sizeof(W_)" assumption as a compile-time
assertion.

Signed-off-by: Herbert Valerio Riedel <email address hidden>

174. By Herbert V. Riedel

Use correct package id for `stg_INTLIKE_closure` import

I'm a bit surprised though this didn't cause linkage errors

(the incorrect import statement was introduced in 7bdcadda7e)

Signed-off-by: Herbert Valerio Riedel <email address hidden>

173. By Kazu Yamamoto <email address hidden>

Fix in-tree GMP build (#8497) on OS X Mavericks

Signed-off-by: Austin Seipp <email address hidden>

172. By Herbert V. Riedel

Wrap `gmpz_fdiv_{q,r,qr}_ui` to optimize `div`/`mod`

This is similiar to what has been done in [af2ba9c8/integer-gmp] for
`gmpz_tdiv_{q,r,qr}_ui` (re #8647); However, the gain is more modest
here, as performance-conscious code tends to use `quot`/`rem` rather
than `div`/`mod`:

     Program Size Allocs Runtime Elapsed TotalMem
 -------------------------------------------------------------
   primetest +0.3% -2.4% 0.06 0.06 +0.0%
         rsa +0.2% -3.3% 0.02 0.02 +0.0%

Signed-off-by: Herbert Valerio Riedel <email address hidden>

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
This branch contains Public information 
Everyone can see this information.

Subscribers