bug-gmp
[Top][All Lists]
Advanced

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

Re: GMP compiled under MacOS/C++ wrap


From: Torbjorn Granlund
Subject: Re: GMP compiled under MacOS/C++ wrap
Date: 24 Apr 2001 13:02:43 +0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.6

Hans Aberg <address@hidden> writes:

  I compiled GMP <ftp://ftp.gnu.org/pub/gnu/gmp/gmp-3.0.tar.gz> generic under
  pre-MacOS X with Metrowerks CodeWarrior Pro 5 C/C++ compiler, using the
  32-bit gmp-mparam.h header. (Note that the Mac G4 CPU is 128 bit, and there
  appears to be no header for that.)
  
It is a stretch to call the G4 a 128-bit CPU.  It has SIMD
instructions operation on 128-bit registers, but it is still a 32-bit
CPU.

It is a different question what limb size we should use in GMP.  We
need a C type that matches a limb, and that limits the choices.  I
strongly doubt usign anything but 32 bits would be a god idea.

  I started on a C++ wrap, classes gmp::integer, gmp::rational, gmp::floating
  that expand to the GMP C functions. If you are interested, please let me
  know. I don not plan to write all GMP functions into that wrap, but it
  would not be difficult to do so. (More info below.)
  
  Some bugs:
  
  - mpq_swap, mpf_swap are mentioned in the manual, but are not in the gmp.h
  header.
  
They seem to be there now.

  - mpz_inp_binary
    mpz_out_binary
    mpf_ceil
    mpf_floor
    mpf_trunc
  are in the gmp.h header, but have no definition.
  
True for mpz_inp_binary and mpz_out_binary (now cleaned up), not true
for the rest.  They are in mpf/integer.c.  Is click-my-icon compilers
like CodeWarrior might not be capable of compiling a file several
times?  I suggest that you use the GNU C/C++ compiler.

  - When including gmp.h under C++, I ran into the problem that gmp.h defines
  the keyword "inline" to empty.

No, it does not.  But gmp-impl.h conditionally defines it to empty.
Is that what you mean?

  Somehow you have to make sure that "inline"
  is defined as normal when the header is finished reading, otherwise it
  produces hard to understand link errors.
  
I don't understand what you're trying to say here.

  - In gmp.h, I noticed the lines:
    /* Really use `defined (__STDC__)' here; we want it to be true for Sun C */
    #if defined (__STDC__) || defined (__cplusplus)
  Note that under C++ (cf. C.1.9:1 in the C++ standard), __STDC__
  implementation defined.
  
What is your point here?

-- 
Torbjörn



reply via email to

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