[llvm] r184834 - [PowerPC] Add extended rotate/shift mnemonics

Chris Lattner clattner at apple.com
Tue Jun 25 14:59:36 PDT 2013


On Jun 25, 2013, at 6:17 AM, Ulrich Weigand <Ulrich.Weigand at de.ibm.com> wrote:

> Author: uweigand
> Date: Tue Jun 25 08:17:41 2013
> New Revision: 184834
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=184834&view=rev
> Log:
> 
> [PowerPC] Add extended rotate/shift mnemonics
> 
> This adds all missing extended rotate/shift mnemonics to the asm parser.

Hi Ulrich,

This sort of code:

> +  case PPC::EXTRWI:
> +  case PPC::EXTRWIo: {
> +    MCInst TmpInst;
> +    int64_t N = Inst.getOperand(2).getImm();
> +    int64_t B = Inst.getOperand(3).getImm();
> +    TmpInst.setOpcode(Opcode == PPC::EXTRWI? PPC::RLWINM : PPC::RLWINMo);
> +    TmpInst.addOperand(Inst.getOperand(0));
> +    TmpInst.addOperand(Inst.getOperand(1));
> +    TmpInst.addOperand(MCOperand::CreateImm(B + N));
> +    TmpInst.addOperand(MCOperand::CreateImm(32 - N));
> +    TmpInst.addOperand(MCOperand::CreateImm(31));
> +    Inst = TmpInst;
> +    break;
> +  }

is really unfortunate.  Is there any way to extend tablegen to generate this for you?

-Chris




More information about the llvm-commits mailing list