Question about clobbering registers in prologue/epilogue code

Steve Ellcey
Tue Sep 24 20:04:00 GMT 2013

On Fri, 2013-09-20 at 07:39 +0100, Richard Sandiford wrote:

> Well, it's really backend code that works out what registers need
> to be saved and restored, although it's based on generic information.
> So it should just be a case of making mips_save_reg_p return true for
> all FP registers in an fp64_compat function.  The prologue would then
> need to restore any incoming float arguments after the mode switch.
> Thanks,
> Richard

Thanks for the ideas Richard, I have played around with this some more
and one of the things I am having trouble with is trying to determine if
any floating point registers were used for arguments.  I could just save
and restore $f12 and $f14 every time, but ideally I would only want to
do that if they were actually used for arguments.  I can't seem to
figure out how to determine that.  It looks like I can determine if $f0
is used for a return value by using mips_return_mode_in_fpr_p but I
can't find something equivalent for argument registers.  Any ideas?

Steve Ellcey

More information about the Gcc mailing list