From: Ulrich Weigand Date: Mon, 24 Jun 2013 18:08:03 +0000 (+0000) Subject: [PowerPC] Support some miscellaneous mnemonics in the asm parser X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=96fb3a25cb0007f06d22d28c0b9c3503798324f6 [PowerPC] Support some miscellaneous mnemonics in the asm parser This adds support for the following extended mnemonics: xnop mr. not not. la git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184767 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp b/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp index 6803d664bc4..6e075f205bf 100644 --- a/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp +++ b/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp @@ -423,6 +423,15 @@ void PPCAsmParser:: ProcessInstruction(MCInst &Inst, const SmallVectorImpl &Operands) { switch (Inst.getOpcode()) { + case PPC::LAx: { + MCInst TmpInst; + TmpInst.setOpcode(PPC::LA); + TmpInst.addOperand(Inst.getOperand(0)); + TmpInst.addOperand(Inst.getOperand(2)); + TmpInst.addOperand(Inst.getOperand(1)); + Inst = TmpInst; + break; + } case PPC::SLWI: { MCInst TmpInst; int64_t N = Inst.getOperand(2).getImm(); diff --git a/lib/Target/PowerPC/PPCInstrInfo.td b/lib/Target/PowerPC/PPCInstrInfo.td index 34336964066..ee992c03cb9 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.td +++ b/lib/Target/PowerPC/PPCInstrInfo.td @@ -2266,7 +2266,15 @@ class PPCAsmPseudo def : InstAlias<"sc", (SC 0)>; +def : InstAlias<"xnop", (XORI R0, R0, 0)>; + def : InstAlias<"mr $rA, $rB", (OR8 g8rc:$rA, g8rc:$rB, g8rc:$rB)>; +def : InstAlias<"mr. $rA, $rB", (OR8o g8rc:$rA, g8rc:$rB, g8rc:$rB)>; + +def : InstAlias<"not $rA, $rB", (NOR8 g8rc:$rA, g8rc:$rB, g8rc:$rB)>; +def : InstAlias<"not. $rA, $rB", (NOR8o g8rc:$rA, g8rc:$rB, g8rc:$rB)>; + +def LAx : PPCAsmPseudo<"la $rA, $addr", (ins gprc:$rA, memri:$addr)>; def SLWI : PPCAsmPseudo<"slwi $rA, $rS, $n", (ins gprc:$rA, gprc:$rS, u5imm:$n)>; diff --git a/test/MC/PowerPC/ppc64-encoding-ext.s b/test/MC/PowerPC/ppc64-encoding-ext.s index 101c9917338..f6bfa6916a7 100644 --- a/test/MC/PowerPC/ppc64-encoding-ext.s +++ b/test/MC/PowerPC/ppc64-encoding-ext.s @@ -1899,15 +1899,20 @@ # CHECK: nop # encoding: [0x60,0x00,0x00,0x00] nop -# FIXME: xnop +# CHECK: xori 0, 0, 0 # encoding: [0x68,0x00,0x00,0x00] + xnop # CHECK: li 2, 128 # encoding: [0x38,0x40,0x00,0x80] li 2, 128 # CHECK: lis 2, 128 # encoding: [0x3c,0x40,0x00,0x80] lis 2, 128 -# FIXME: la 2, 128(4) +# CHECK: la 2, 128(4) + la 2, 128(4) # CHECK: mr 2, 3 # encoding: [0x7c,0x62,0x1b,0x78] mr 2, 3 -# FIXME: mr. 2, 3 -# FIXME: not 2, 3 -# FIXME: not. 2, 3 +# CHECK: or. 2, 3, 3 # encoding: [0x7c,0x62,0x1b,0x79] + mr. 2, 3 +# CHECK: nor 2, 3, 3 # encoding: [0x7c,0x62,0x18,0xf8] + not 2, 3 +# CHECK: nor. 2, 3, 3 # encoding: [0x7c,0x62,0x18,0xf9] + not. 2, 3