The issue I am rasing here is Windows x64 specific and does not affect MPIR 
on other architectures.

The mpir_ui and mpir_si types were introduced in MPIR to allow all x64 
systems (including Windows x64) to handle 64-bit integers as the norm.

This has worked well but recently one incompatibility between GMP and MPIR 
that was introduced by this change has shown up as an issue.

For the most part compilers will do the necessary promotions/conversions 
between longs and mpir_si/ui types when passed as integer parameters but 
this is not true for parameters passed via pointers.

Fortunately there are only two functions in the MPIR interface where 
pointers to these types are used in parameter passing:

  double mpz_get_d_2exp (mpir_si *exp2, mpz_srcptr src);
  double mpf_get_d_2exp (mpir_si *exp2, mpf_srcptr src);

But these will lead to problems if the wrong pointer types are used and 
also creates a significant incompatibility bwtween MPIR and GMP since the 
latter defines these functions with signed long pointers:

  double mpz_get_d_2exp (signed long *exp2, mpz_srcptr src);
  double mpf_get_d_2exp (signed long *exp2, mpf_srcptr src);

When I added the mpir_ui/mpir_si changes to MPIR, I changed these two 
functions since it seemed sensible to maintain a consistent interface for 
signed and unsigned integers.  

But this is actually an unecessary change since the exponent being passed 
in 'exp2' is a 32-bit integer in MPIR anyway so we don't need a pointer to 
a 64-bit value to return it. 

So the simplest way of removing this incompatibility is simply to use the 
GMP definitions for these two functions.  

But this might cause issues for anyone who is using these functions in 
their current form so I am raising the issue here so that people can 
consider the change and any impact that it may have upon them.

Please let me know if you foresee any significant issues with the change.

I stress again that this is an issue that only affects Windows x64.

    best regards to all,

       Brian

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mpir-devel+unsubscr...@googlegroups.com.
To post to this group, send email to mpir-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/mpir-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to