On Mon, Jun 10, 2013 at 06:31:55PM -0700, Andrew Pinski wrote:
> On Mon, Jun 10, 2013 at 6:00 PM, David Edelsohn <[email protected]> wrote:
> > On Mon, Jun 10, 2013 at 8:26 PM, Alan Modra <[email protected]> wrote:
> >
> >> The following patch disables lower-subreg for double double TFmode,
> >> bootstrap and regression tests are OK, but I'm a little unsure whether
> >> this is the right thing to do.
> >>
> >> * rs6000.c (TARGET_INIT_LOWER_SUBREG): Define.
> >> (rs6000_init_lower_subreg): New function.
> >> * lower-subreg.c (init_lower_subreg): Call
> >> targetm.init_lower_subreg.
> >> * target.def (init_lower_subreg): New.
> >> * doc/tm.texi.in (TARGET_INIT_LOWER_SUBREG): Document.
> >> * doc/tm.texi: Regenerate.
> >
> > I agree with the rs6000 bits. You need someone else to approve the
> > common bits. This also needs a testcase.
>
> I thought there was a way already to disable lower subreg already for
> some modes.
There is, via rtx_costs. In fact that was my first approach, with the
following in rs6000_rtx_costs, but this potentially affects other
areas of the compiler.
case SET:
if (GET_MODE (SET_DEST (x)) == TFmode
&& !TARGET_IEEEQUAD
&& TARGET_HARD_FLOAT
&& (TARGET_FPRS || TARGET_E500_DOUBLE)
&& TARGET_LONG_DOUBLE_128)
/* This hack is to persuade lower_subreg to not lower
TFmode regs to DImode. */
*total = COSTS_N_INSNS (2) - 1;
break;
--
Alan Modra
Australia Development Lab, IBM