This is the mail archive of the
mailing list for the GCC project.
subreg_regno_offset (Was: Re: gcc compile-time performance)
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: "David S. Miller" <davem at redhat dot com>
- Cc: shebs at apple dot com, dberlin at dberlin dot org, dhazeghi at pacbell dot net, neil at daikokuya dot demon dot co dot uk, ak at suse dot de, gcc at gcc dot gnu dot org
- Date: Tue, 21 May 2002 21:21:06 +0100
- Subject: subreg_regno_offset (Was: Re: gcc compile-time performance)
- Organization: SuperH UK Ltd.
> I know that the subreg-byte changes added a lot of overhead
> particularly via the subreg_regno_offset() function (which was
> an inline macro in my original diffs).
> The divisions are what kill it. That overhead could be eliminated
> if all the mode sizes were powers of 2 and we had some
> GET_MODE_SIZE_LOG2() interface. Then we just transform all the
> divides there into shifts.
The divides in subreg_regno_offset don't make much sense anyways.
Consider a target where PSImode and SImode are the same size (obviously),
but where SImode needs more hard registers.
A PSImode subreg of a SImode value gets you a division by zero error.
I think it is better to have a simple default definition for
subreg_regno_offset - e.g., just return what is currently calculated
as ymode (of course you can use a run-time generated lookup table to
speed that up). Any target that does not fit into that scheme can
then define its own version.
With the lookup table, the vanilla version can even be made to fit
targets where single precision values are held in double-precision
registers, by looping for each mode through MODE_WIDER_MODE and using
the size of the largest mode that occupies the same number of hard
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330