gmp-impl.h assumes 32-bit unsigned int in fft_table_nk

Robert Baruch robert.c.baruch at gmail.com
Sat Dec 19 04:09:05 UTC 2015


Oh, BTW, there is also the same problem in mpn/trialdiv.c:68, where
gmp_primes_tab has a 24-bit field in an unsigned int.

On Fri, Dec 18, 2015 at 8:06 PM Robert Baruch <robert.c.baruch at gmail.com>
wrote:

> Thanks for the discussion! The fun thing is that I'll try to deal with
> integers on the order of 200 decimals (figure on the order of 700 bits). I
> think that mini-gmp is billed as "several orders of magnitude slower" than
> gmp on numbers over a few hundred bits, so I'd still like to see what gmp
> does (with --disable-fft).
>
> On Fri, Dec 18, 2015 at 7:50 AM Torbjörn Granlund <tg at gmplib.org> wrote:
>
>> Marc Glisse <marc.glisse at inria.fr> writes:
>>
>>   We have --disable-fft, maybe the code in gmp-impl.h could be protected
>>   by WANT_FFT. gmp_uint_least32_t also looks like it is unlikely to
>>   hurt, and we are already using it for other bitfields in the same
>>   file.
>>
>>   Those changes could make sense whether we support 16 bit systems or not.
>>
>> Agreed with both suggestions.  (Our usage of unsigned long as basetype
>> is not standards conformant, and it might not work on an environment
>> where int is just 2 bytes.)
>>
>> --
>> Torbjörn
>> Please encrypt, key id 0xC8601622
>>
>


More information about the gmp-bugs mailing list