[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp

Chris Lattner sabre at nondot.org
Wed Aug 17 20:25:55 PDT 2005


On Wed, 17 Aug 2005, Nate Begeman wrote:
> +  case ISD::SIGN_EXTEND_INREG:
> +    switch(cast<VTSDNode>(N->getOperand(1))->getVT()) {
> +    default: assert(0 && "Illegal type in SIGN_EXTEND_INREG"); break;
...
> +    case MVT::i1:
> +      CurDAG->SelectNodeTo(N, MVT::i32, PPC::SUBFIC, Select(N->getOperand(0)),
> +                           getI32Imm(0));
> +      break;

BTW, I don't think this is right.  This would miscompile in the case where 
the input has a value of "2", for example (returning 0-2).  It would 
probably be better to say that this is not legal so the legalizer turns 
it into shl/sar, unless there is a way to make this work trickily.

We haven't noticed this because SEXT_INREG from a bool is not really 
possible to generate yet.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-commits mailing list