This is the mail archive of the
mailing list for the GCC project.
Re: dangerous cleverness? ppc int<->float conversions, subreg
On Tue, Oct 23, 2001 at 12:42:29AM +0100, Joern Rennecke wrote:
> > At first look this is a straightforward change to HARD_REGNO_MODE_OK for
> > each target that currently allows use of float registers for integer modes.
> > However, I tripped over a detail of the rs6000 machine description: the
> > architecture's float<->int conversion instructions pick up or deposit
> > integers in the float registers, and the machine description therefore
> > has patterns such as
> > (set (match_operand:DI 0 "gpc_reg_operand" "=f")
> > (fix:DI (match_operand:DF 1 "gpc_reg_operand" "f")))
> I think the way to go is to use a different register class / different
> union classes for floating point registers for operations that can do
> without floating point registers.
> So your switch would disable fp registers for integer operations by
> removing fp registers from the register classes that are allowed according
> to the register constraints, typically in CONDITIONAL_REGISTER_USAGE.
> Whereas you leave the register classes used by genuine fp operations like
> fix alone.
I didn't know about CONDITIONAL_REGISTER_USAGE. Thanks for the pointer.
That could work for PPC, but I don't think it will work for Sparc.
Sparc has the exact same situation with the fix/float patterns.
Unlike PPC, however, moves from fp to integer regs use plain old
movdi. (I think.) Therefore, I don't think either my SUBREG trick or
your regclass trick will work. There doesn't seem to be any way to
say "DImode in FLOAT_REGS is only allowed if it's input to float?i?f
or output of fix?f?i"...