This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

subreg_regno_offset (Was: Re: gcc compile-time performance)


> 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
registers.

-- 
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]