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). Other than that: looks fine, thanks! Segher