[llvm] r178480 - Add more PPC floating-point conversion instructions

Bill Schmidt wschmidt at linux.vnet.ibm.com
Mon Apr 1 20:57:00 PDT 2013


On Mon, 2013-04-01 at 22:33 -0500, Hal Finkel wrote:

> > > 
> > > @@ -4826,10 +4879,14 @@ SDValue PPCTargetLowering::LowerSINT_TO_
> > >        MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIdx),
> > >                                MachineMemOperand::MOLoad, 4, 4);
> > >      SDValue Ops[] = { Store, FIdx };
> > > -    Ld = DAG.getMemIntrinsicNode(PPCISD::LFIWAX, dl,
> > > -                                 DAG.getVTList(MVT::f64,
> > > MVT::Other), Ops, 2,
> > > -                                 MVT::i32, MMO);
> > > +    Ld = DAG.getMemIntrinsicNode(Op.getOpcode() == ISD::UINT_TO_FP
> > > ?
> > > +                                   PPCISD::LFIWZX :
> > > PPCISD::LFIWAX,
> > > +                                 dl, DAG.getVTList(MVT::f64,
> > > MVT::Other),
> > > +                                 Ops, 2, MVT::i32, MMO);
> > 
> > This code can be entered if hasLFIWAX() is true and hasFPCVT() is
> > false.
> > In that case, if the opcode is UINT_TO_FP, code will be generated to
> > use
> > LFIWZX even though hasFPCVT() is false.  This will generate illegal
> > code
> > on P6 and P6+.
> 
> No, this entire function is not used in that case (UINT_TO_FP is marked as Expand). To check this, I placed this assert at the top of the function:
> 
>   assert((Op.getOpcode() == ISD::SINT_TO_FP || PPCSubTarget.hasFPCVT()) &&
>          "UINT_TO_FP is supported only with FPCVT");

OK, agreed, thanks!  I should have spotted that.

Bill





More information about the llvm-commits mailing list