On Tue, Sep 26, 2017 at 11:36:14AM -0500, Segher Boessenkool wrote:
> Hi!
> 
> On Tue, Sep 26, 2017 at 10:34:44AM -0400, Michael Meissner wrote:
> >     * config/rs6000/rs6000.md (movsi_from_df): Optimize converting a
> >     DFmode to a SFmode, and then needing to move the SFmode to a GPR
> >     to use the XSCVDPSP instruction instead of FRSP and XSCVDPSPN.
> 
> > --- gcc/config/rs6000/rs6000.md     (revision 253170)
> > +++ gcc/config/rs6000/rs6000.md     (working copy)
> > @@ -6919,6 +6919,26 @@ (define_insn_and_split "*movdi_from_sf_z
> >             "4,          4,           4,           4,        8,
> >              8,          4")])
> >  
> > +;; Like movsi_from_sf, but combine a convert from DFmode to SFmode before
> > +;; moving it to SImode.  We can do a SFmode store without having to do the
> > +;; conversion explicitly.  If we are doing a register->register 
> > conversion, use
> > +;; XSCVDPSP instead of XSCVDPSPN, since the former handles cases where the
> > +;; input will not fit in a SFmode, and the later assumes the value has 
> > already
> > +;; been rounded.
> > +(define_insn "*movsi_from_df"
> > +  [(set (match_operand:SI 0 "nonimmediate_operand"         "=wa,m,wY,Z")
> > +   (unspec:SI [(float_truncate:SF
> > +                (match_operand:DF 1 "gpc_reg_operand" "wa, f,wb,wa"))]
> > +               UNSPEC_SI_FROM_SF))]
> 
> (The indentation is a bit broken here -- DF line is indented a space too
> many, and the constraint strings do not line up).

That must something funky with patches and tabs.  It looks ok after I apply the
patch (the match_operand:DF is indented one space under float_truncate:SF).

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797

Reply via email to