On Fri, 2013-08-16 at 19:11 +0200, Jakub Jelinek wrote:
> On Fri, Aug 16, 2013 at 12:06:56PM -0500, Peter Bergner wrote:
> > --- gcc/config/rs6000/dfp.md (revision 201779)
> > +++ gcc/config/rs6000/dfp.md (working copy)
> > @@ -135,8 +135,15 @@ (define_insn "*negtd2_fpr"
> > [(set (match_operand:TD 0 "gpc_reg_operand" "=d")
> > (neg:TD (match_operand:TD 1 "gpc_reg_operand" "d")))]
> > "TARGET_HARD_FLOAT && TARGET_FPRS"
> > - "fneg %0,%1"
> > - [(set_attr "type" "fp")])
> > + "*
> > +{
> > + if (REGNO (operands[0]) == REGNO (operands[1]))
> > + return \"fneg %0,%1\";
> > + else
> > + return \"fneg %0,%1\;fmr %L0,%L1\";
> > +}"
> > + [(set_attr "type" "fp")
> > + (set_attr "length" "8")])
>
> Is the length right for the firt case though?
> I mean, shouldn't the insn have two alternatives:
> =d,d 0,d and length 4,8 ?
To be honest, I basically just cut/pasted the negtf2_internal pattern
without looking too closely, but I agree you are right. I'll redo the
patch with your suggestion. negtf2_internal always generates two insns,
so it doesn't need any changes.
Peter