This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: dangerous cleverness? ppc int<->float conversions, subreg


> 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.

--
Joern Rennecke                  |            gcc expert for hire
amylaar@onetel.net.uk           |  send enquiries to: jwr_jobs@onetel.net.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]