mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-16 00:17:32 +00:00
[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
This commit is contained in:
parent
89ced61187
commit
96fb3a25cb
@ -423,6 +423,15 @@ void PPCAsmParser::
|
||||
ProcessInstruction(MCInst &Inst,
|
||||
const SmallVectorImpl<MCParsedAsmOperand*> &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();
|
||||
|
@ -2266,7 +2266,15 @@ class PPCAsmPseudo<string asm, dag iops>
|
||||
|
||||
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)>;
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user