GMP and 64-bit systems

Roberto Bagnara bagnara at cs.unipr.it
Sun Jun 1 16:43:02 CEST 2008


Torbjorn Granlund wrote:
> There is one tricky thing about this, and it is whether to assume
> "long long" exixts.  When I started working on GMP, it certainly
> wasn't ubiquitous.  Unfortunately, I don't think we can assume it is
> now, since it was not specified until C99.
> 
> We want there to be one GMP ABI, so we cannot define a user visible
> function with "long long" unless we decide to de-support C89
> environments.
> 
> Furthermore, we cannot use "long long" on systems just because one
> compiler on that system supports it.  If we put long long in gmp.h on
> such a system, people using the other compiler will get surprises.

Hi Torbjorn,

I more or less understand your concerns, but not having support for
"long long" in the interfaces is a big limitation (we have to maintain
our own slow workarounds and so on).  Would it be acceptable to reason
as follows?

1) "long long" is the future (it is in C99, it will be in the C++
    standard, most common compilers support it, ...);
2) the GNU system C compiler supports "long long", so supporting
    "long long" in GMP gives some competitive advantage to GNU;
3) in order to support old, non-GNU compilers we can #ifdef out
    the "long long" portion of gmp.h and gmpxx.h.

I realize this breaks the rule "we want there to be one GMP ABI",
a rule I only partly understand.  The ABI should not be changed
every other day, but I don't think this should impede progress
forever.  Old (obsoletizing) systems would simply use a subset of the
functionalities of newer GMPs;  new systems would take full advantage
of modern language standards and compiler technology.
All the best,

    Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it


More information about the gmp-discuss mailing list