summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/Disassembler
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2013-02-17 22:38:05 +0000
committerRichard Osborne <richard@xmos.com>2013-02-17 22:38:05 +0000
commit53fff945274e358046a2f6be62ffaccfd1a01b7d (patch)
treef33417fee88fee8ecc3fb077a6101a896f3f5f79 /llvm/lib/Target/XCore/Disassembler
parentf5a3ffcba93ef6c4ed04f568bf7211bf47331ca1 (diff)
downloadbcm5719-llvm-53fff945274e358046a2f6be62ffaccfd1a01b7d.tar.gz
bcm5719-llvm-53fff945274e358046a2f6be62ffaccfd1a01b7d.zip
[XCore] Add missing 2r instructions.
These instructions are not targeted by the compiler but it is needed for the MC layer. llvm-svn: 175407
Diffstat (limited to 'llvm/lib/Target/XCore/Disassembler')
-rw-r--r--llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp b/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp
index 0bae15c0141..7e7d3962a72 100644
--- a/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp
+++ b/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp
@@ -100,6 +100,11 @@ static DecodeStatus Decode2RInstruction(MCInst &Inst,
uint64_t Address,
const void *Decoder);
+static DecodeStatus Decode2RImmInstruction(MCInst &Inst,
+ unsigned Insn,
+ uint64_t Address,
+ const void *Decoder);
+
static DecodeStatus DecodeR2RInstruction(MCInst &Inst,
unsigned Insn,
uint64_t Address,
@@ -345,6 +350,19 @@ Decode2RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address,
}
static DecodeStatus
+Decode2RImmInstruction(MCInst &Inst, unsigned Insn, uint64_t Address,
+ const void *Decoder) {
+ unsigned Op1, Op2;
+ DecodeStatus S = Decode2OpInstruction(Insn, Op1, Op2);
+ if (S != MCDisassembler::Success)
+ return Decode2OpInstructionFail(Inst, Insn, Address, Decoder);
+
+ Inst.addOperand(MCOperand::CreateImm(Op1));
+ DecodeGRRegsRegisterClass(Inst, Op2, Address, Decoder);
+ return S;
+}
+
+static DecodeStatus
DecodeR2RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address,
const void *Decoder) {
unsigned Op1, Op2;
OpenPOWER on IntegriCloud