integer-gmp2 issues on Solaris/SPARC

Herbert Valerio Riedel hvriedel at gmail.com
Mon Jan 19 09:54:14 UTC 2015


On 2015-01-19 at 10:25:59 +0100, Karel Gardas wrote:

[...]

>  /* Major version number is the value of __GNU_MP__ too, above and in
> mp.h. */
>  #define __GNU_MP_VERSION 4
>
>
> Let me also add that the gmp.h file does not define mpn_andn_n symbol
> at all neither it declare __gmpn_andn_n function! Since both i386 and
> sparc gmp.h are the same this applies to both.

Oh, I just checked the documentation, and `mpn_andn_n()` is only
mentioned in the GMP 5.0.x docs

 https://gmplib.org/manual-5.0.4/Low_002dlevel-Functions.html#Low_002dlevel-Functions

but not in

 https://gmplib.org/manual-4.3.2/Low_002dlevel-Functions.html#Low_002dlevel-Functions


[...]

> The big issue here is that i386/solaris gmp library so file provides
> this __gmpn_andn_n symbol but have not declared it in gmp.h at all in
> a form of mpn_andn_n define. So basically your:
> -- void mpn_andn_n (mp_limb_t *rp, const mp_limb_t *s1p, const
> mp_limb_t *s2p,
> --                  mp_size_t n)
> foreign import ccall unsafe "gmp.h __gmpn_andn_n"
>   c_mpn_andn_n :: MutableByteArray# s -> ByteArray# -> ByteArray# -> 
> GmpSize#
>                   -> IO ()
>
>
> works on i386, but not on sparc.
>
> Is it possible for you to test for those mpn_ symbols in integrer-gmp2
> configure and if they are presented then you can use your
> __gmpn_andn_n foreigner call?

I'm actually rather considering not using those at all when GMP version
is 4.* as they're not part of the official API of GMP 4.x

Btw, how long do we need to keep supporting GMP 4.x (as it lacks a few
other features)?

GMP 5.0.0 has been released over 5 years ago... :-/

Cheers,
  hvr


More information about the ghc-devs mailing list