IA64 inline division question
Jim Wilson
wilson@specifixinc.com
Thu Feb 12 02:24:00 GMT 2004
On Wed, 2004-02-11 at 16:39, Steve Ellcey wrote:
> So why is the save/restore done as a DImode instead of SFmode, which is
> what the register actually contains? For that matter, why isn't it
> done with real spill/fill instructions?
This is machine independent code in caller-save.c. It tries to
determine the size of the register by the largest mode that it will
support, and then it uses this mode for saves and restores. This ends
up picking DImode which is wrong. See regno_save_mode in
init_caller_save. See also the HARD_REGNO_CALLER_SAVE_MODE macro, and
the choose_hard_reg_mode function in regclass.c. We could solve this by
defining our own HARD_REGNO_CALLER_SAVE_MODE macro. However, anything
which calls choose_hard_reg_mode directly is still broken, and we might
need a fix for that. Or maybe not. This isn't clear. The fundamental
problem here seems to be that hard_regno_nregs (FP reg, DImode) returns
1, when the actual value is about 1.25, but hard_regno_nregs must return
an integer. Maybe the function should continue until it finds the
largest mode of any class that fits in a register, instead of stopping
when it finds one for which hard_regno_nregs is 1.
The machine independent code obviously has no concept of spill/fill
instructions, and there is no way to get them by selecting modes. It
just generates ordinary load/store instructions. We could add a hook
for this, for targets with special save/restore instructions. See the
reg_save_code and reg_restore_code arrays set in init_rtl in
caller-save.c.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc
mailing list