[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: |
Philipp Stephani |
Subject: |
Re: [PATCH] Change module interface to no longer use GMP objects directly. |
Date: |
Tue, 10 Dec 2019 00:15:13 +0100 |
Am Mo., 9. Dez. 2019 um 04:27 Uhr schrieb Eli Zaretskii <address@hidden>:
>
> > 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.
In other words, you'd like it to be an alias for uintptr_t? I'd be
totally fine with that as well.
- Re: [PATCH] Change module interface to no longer use GMP objects directly., Philipp Stephani, 2019/12/04
- Re: [PATCH] Change module interface to no longer use GMP objects directly., Eli Zaretskii, 2019/12/05
- Re: [PATCH] Change module interface to no longer use GMP objects directly., Philipp Stephani, 2019/12/08
- Re: [PATCH] Change module interface to no longer use GMP objects directly.,
Philipp Stephani <=
- Re: [PATCH] Change module interface to no longer use GMP objects directly., Paul Eggert, 2019/12/09
- Re: [PATCH] Change module interface to no longer use GMP objects directly., Philipp Stephani, 2019/12/10
- Re: [PATCH] Change module interface to no longer use GMP objects directly., Eli Zaretskii, 2019/12/10
- Re: [PATCH] Change module interface to no longer use GMP objects directly., Philipp Stephani, 2019/12/14
- Re: [PATCH] Change module interface to no longer use GMP objects directly., Paul Eggert, 2019/12/14
Re: [PATCH] Change module interface to no longer use GMP objects directly., Paul Eggert, 2019/12/08