[PATCH] Support powerpc64le-linux platform

Torbjorn Granlund tg at gmplib.org
Sun Dec 8 14:49:05 UTC 2013


Ulrich Weigand <Ulrich.Weigand at de.ibm.com> writes:

  > Testing cpp symbols for ABI version makes me a bit nervous.  Such things
  > can easily get out-of-synch.  It might be more resilient to check a
  > generated object.
  
  Well, the _CALL_ELF check is what we use for all other packages that
  needed ELFv2 changes, starting from glibc ...  So if that ever gets
  out of sync, we'll have bigger problems anyway.
  
That's reassuring.  :o)

  > Is the setting of of a TOC pointer unconditionally really needed
  > (presumably for a call from another shlib including the main program)
  > even for leaf functions which also don't use the TOC?
  
  If a function does not use the TOC (either explicitly or implicitly
  e.g. because it performs a function call), then we do not need to
  set it up in the prolog.  However, since there was just a single
  PROLOGUE macro, it seemed the safe course to set it always.
  
  Now, if we know for sure that none of the functions needs a TOC,
  we can omit it completely.  Or else, we could introduce two versions
  of the PROLOGUE macro, and let each function choose the right one.
  
We have for other machines allowed an optional 2nd argument for
PROLOGUE.

  I'm not sure if this is really worth the effort though: it makes
  a difference only if the function is called externally (from another
  shared library or via function pointer).  Aren't those routines
  mostly called locally anyway?  Local calls will bypass the TOC
  setup automatically anyway.
  
It will help time-critical end-user programs which call documented mpn
functions directly.

Some asm files do use the TOC (typically mode1o.asm, invert_limb.asm,
mod_1_[1234].asm, gcd_1.asm).

I'd suggest using PROLOGUE(fn,toc) for the latter functions, and
PROLOGUE(fn) for other functions.

For the v1 ABI, I assume we cannot be clever about this.

  > Is there a way we could test powerpc64le-linux or the new abi?  We try
  > to have (automated) tests for every ABI which we claim to be supporting.
  
  Right now there is no base OS for powerpc64le-linux that you could
  install readily, and there's also no easy way to get a machine to
  run this on.  I'm sure once we're a bit farther along, we'll try
  to make a powerpc64le-linux test machine available, e.g. in the
  GCC compile farm.
  
I usually simulate GMP test systems.

Torbjörn



More information about the gmp-devel mailing list