Speeding internal GMP calls

Torbjorn Granlund tege@swox.com
30 Nov 2002 18:05:09 +0100


Many environments generate a stub for call internal in a
shared library.  This stub sets up the gp register when the
call actually comes from a different shared lib or from the
main program, and in some cases restores the caller gp upon
return.

At least a few environments allow one to choose whether to
jump via the linker stub for internal library calls.  The
idea is that if a linker stub is used, a user may override
the callee routine with her own implementation.

I think that we should not allow user override of GMP
routines since the cost for executing the linker stubs is
too high.  (We should perhaps have an configure-time option,
--enable-override.)

Anybody want to work in improving the GMP build system to
get rid of the stubs?  It requires reading compiler/linker
docs for some systems, and check libtool's capabilities in
this area.

I think it will turn out to be an important optimization for
many platforms, so it would be a useful contribution to the
GMP user community.

--
Torbjörn