Matthew Fortune <matthew.fort...@imgtec.com> writes: > Hi Richard, > > As part of implementing the new O32 FPXX ABI I am making use of the > HARD_REGNO_CALL_PART_CLOBBERED macro to allow odd-numbered > floating-point registers to be considered as 'normally' callee-saved > but call clobbered if they are being used to hold SImode or SFmode > data. The macro is implemented as: > > /* Odd numbered single precision registers are not considered call saved > for O32 FPXX as they will be clobbered when run on an FR=1 FPU. */ > #define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) \ > (TARGET_FLOATXX && ((MODE) == SFmode || (MODE) == SImode) \ > && FP_REG_P (REGNO) && (REGNO & 1))
Under these conditions the entire value is call-clobbered though. It might be better to say that the odd-numbered registers are always call-clobbered (which I think is more accurate) but force them to be saved by functions that use them. This is in some ways similar to the way that interrupt handlers save call-clobbered registers. Maybe some RA heuristics will need tweaking to reflect the extra cost of these registers, but I imagine that's true either way. Thanks, Richard