Improving gcc for gmp

Torbjorn Granlund tg at swox.com
Fri Mar 19 02:26:17 CET 2004


Many machines have to GMP vital instructions, like what we do with
umul_ppmm and count_leading_zeros, yet is there no language constructs
to use these.  Inline assembly has critical drawbacks in that it
blindfolds the scheduler of the compiler.

I'd like to see extensions of gcc to support __builtin_ constructs for
at least umul_ppmm (or rather umul_high) and count_leading_zeros.
Since the backends already have support for the former (and perhaps
also the latter) and since there are actually ready mechansims for
using that (see expand_mult_highpart in expmed.c) implementing this
should be fairly straightforward.

I don't have time to do this.  Could somebody on this list please look
into writing the code, and submitting it to the GCC folks?

--
Torbjörn


More information about the gmp-devel mailing list