This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Integer moves for fp regs
- To: Michael Hayes <michaelh at ongaonga dot chch dot cri dot nz>
- Subject: Re: Integer moves for fp regs
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 29 Jul 1998 16:03:11 -0600
- cc: egcs at cygnus dot com, gcc2 at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199807292139.VAA06864@ongaonga.chch.cri.nz>you write:
> Jeffrey A Law writes:
> > I believe it is still necessary if HARD_REGNO_MODE_OK allows floating
> > point registers to hold integer mode values.
>
> Do you know which bits of GCC require this behaviour?
The register allocators & reload. Sorry, hard to be more specific
than that.
The last time I had to work on a problem related to this code was
4 or 5 years ago. Basically gcc decided it was better to hold some
integer value in a floating point register than flushing it to memory
(all the integer regs were already used).
For the target in question (PA) that was normally OK. However for
various reasons we turned off the FPU as we entered the kernel on our
BSD & Mach ports. So when the code stuffed the value into the FP reg
we got a wonderful kernel panic.
We dealt with this by making the FP regs fixed when building the kernel.
> Yes, it does this. However, if HARD_REGNO_MODE_OK allows both
> floating point and integer modes of the same size for a register,
> then caller save will use integer save/restore instructions.
> For most architectures this is of no concern since the representation
> of the bit pattern is not important.
Of course -- if HARD_REGNO_MODE_OK allows it, then caller-save.c knows
no reason why it can't use an integer mode load/store to save/restore
floating point registers.
jeff