emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Change module interface to no longer use GMP objects directl


From: Eli Zaretskii
Subject: Re: [PATCH] Change module interface to no longer use GMP objects directly.
Date: Mon, 09 Dec 2019 05:26:56 +0200

> From: Philipp Stephani <address@hidden>
> Date: Sun, 8 Dec 2019 21:28:12 +0100
> Cc: Paul Eggert <address@hidden>, Philipp Stephani <address@hidden>, 
>       Andreas Schwab <address@hidden>, Stefan Monnier <address@hidden>, 
>       Emacs developers <address@hidden>
> 
> Am Do., 5. Dez. 2019 um 15:43 Uhr schrieb Eli Zaretskii <address@hidden>:
> >
> > However, this:
> >
> >   #if ULONG_MAX == 0xFFFFFFFF
> >   typedef unsigned long long emacs_limb_t;
> >   # define EMACS_LIMB_MAX ULLONG_MAX
> >   #else
> >   typedef unsigned long emacs_limb_t;
> >   # define EMACS_LIMB_MAX ULONG_MAX
> >   #endif
> >
> > seems to punish every 32-bit build of Emacs (and on MS-Windows even
> > the 64-bit builds, AFAIU).  Is there a reason for doing this?  Testing
> > for the native size of an 'unsigned long' data type is not
> > significantly more complicated than the above, and GMP goes with that
> > when it determines the type of mp_limb_t, AFAIK.
> 
> Not quite sure I understand. In what way does this selection punish
> 32-bit builds?

It makes emacs_limb_t be a 64-bit type, whereas mp_limb_t is a 32-bit
type in that case, and that makes the interface less efficient,
because GMP is optimized for the case where they match.

> Also the code already effectively tests the native size of unsigned
> long, so I'm not sure what you'd like to change here.

I'd like to make emacs_limb_t be an unsigned long in 32-bit builds, to
match mp_limb_t.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]