[PATCH], Add PowerPC ISA 3.0 lxsihzx, lxsibzx, stxsihx, stxsibx support

Michael Meissner meissner@linux.vnet.ibm.com
Mon Jun 27 21:38:00 GMT 2016


On Mon, Jun 27, 2016 at 03:05:19PM -0500, Segher Boessenkool wrote:
> On Thu, Jun 23, 2016 at 06:37:15PM -0400, Michael Meissner wrote:
> > PowerPC ISA 3.0 adds new instructions (LXSIHZX, LXSIBZX, STXSIHX, and STXSIBX)
> > that allow you to load and zero extend byte and half word values from memory
> > and to store them back.
> 
> Okay for trunk with fixes below; okay for 6 later.
> 
> > @@ -872,7 +878,6 @@ (define_insn_and_split "*zero_extendsi<m
> >     (set_attr "dot" "yes")
> >     (set_attr "length" "4,8")])
> >  
> > -
> >  (define_insn "extendqi<mode>2"
> >    [(set (match_operand:EXTQI 0 "gpc_reg_operand" "=r")
> >  	(sign_extend:EXTQI (match_operand:QI 1 "gpc_reg_operand" "r")))]
> 
> Unrelated whitespace change, please don't.

I generally try to clean things up as I'm editing code.

> > @@ -5188,6 +5193,107 @@ (define_insn_and_split "*floatunssidf2_i
> >    [(set_attr "length" "20")
> >     (set_attr "type" "fp")])
> >  
> > +;; ISA 3.0 adds instructions lxsi[bh]zx to directly load QImode and HImode to
> > +;; vector registers.  At the moment, QI/HImode are not allowed in floating
> > +;; point or vector registers, so we use UNSPEC's to use the load byte and
> > +;; half-word instructions.
> > +
> > +(define_expand "float<QHI:mode><FP_ISA3:mode>2"
> > +  [(parallel [(set (match_operand:FP_ISA3 0 "vsx_register_operand" "")
> > +		   (float:FP_ISA3
> > +		    (match_operand:QHI 1 "input_operand" "")))
> > +	      (clobber (match_scratch:DI 2 ""))
> > +	      (clobber (match_scratch:DI 3 ""))])]
> 
> Drop the "" please.

Ok.

> > +  "TARGET_P9_VECTOR && TARGET_DIRECT_MOVE && TARGET_POWERPC64"
> > +{
> > +  if (MEM_P (operands[1]))
> > +    operands[1] = rs6000_address_for_fpconvert (operands[1]);
> 
> That function should get a better name, it's not used soletly for fpconvert
> anymore.  I'm not asking you to do this now, it should be a separate patch
> anyway ;-)

However, in this case, it is doing the address change for a floating point
conversion.  But changing the name of existing functions that are working, tend
to be low on my priority list.

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



More information about the Gcc-patches mailing list