summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/Disassembler
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2013-02-17 22:32:41 +0000
committerRichard Osborne <richard@xmos.com>2013-02-17 22:32:41 +0000
commitf5a3ffcba93ef6c4ed04f568bf7211bf47331ca1 (patch)
tree0e063d48261489438b37b39bfe639fed9ad6f8fd /llvm/lib/Target/XCore/Disassembler
parente3e3feea3ccc782c65f850cb5a46b1c0bdc36179 (diff)
downloadbcm5719-llvm-f5a3ffcba93ef6c4ed04f568bf7211bf47331ca1.tar.gz
bcm5719-llvm-f5a3ffcba93ef6c4ed04f568bf7211bf47331ca1.zip
[XCore] Add TSETR instruction.
This instruction is not targeted by the compiler but it is needed for the MC layer. llvm-svn: 175406
Diffstat (limited to 'llvm/lib/Target/XCore/Disassembler')
-rw-r--r--llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp b/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp
index c995a9c3459..0bae15c0141 100644
--- a/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp
+++ b/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp
@@ -140,6 +140,11 @@ static DecodeStatus Decode3RInstruction(MCInst &Inst,
uint64_t Address,
const void *Decoder);
+static DecodeStatus Decode3RImmInstruction(MCInst &Inst,
+ unsigned Insn,
+ uint64_t Address,
+ const void *Decoder);
+
static DecodeStatus Decode2RUSInstruction(MCInst &Inst,
unsigned Insn,
uint64_t Address,
@@ -313,6 +318,9 @@ Decode2OpInstructionFail(MCInst &Inst, unsigned Insn, uint64_t Address,
case 0x16:
Inst.setOpcode(XCore::EQ_2rus);
return Decode2RUSInstruction(Inst, Insn, Address, Decoder);
+ case 0x17:
+ Inst.setOpcode(XCore::TSETR_3r);
+ return Decode3RImmInstruction(Inst, Insn, Address, Decoder);
case 0x18:
Inst.setOpcode(XCore::LSS_3r);
return Decode3RInstruction(Inst, Insn, Address, Decoder);
@@ -516,6 +524,19 @@ Decode3RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address,
}
static DecodeStatus
+Decode3RImmInstruction(MCInst &Inst, unsigned Insn, uint64_t Address,
+ const void *Decoder) {
+ unsigned Op1, Op2, Op3;
+ DecodeStatus S = Decode3OpInstruction(Insn, Op1, Op2, Op3);
+ if (S == MCDisassembler::Success) {
+ Inst.addOperand(MCOperand::CreateImm(Op1));
+ DecodeGRRegsRegisterClass(Inst, Op2, Address, Decoder);
+ DecodeGRRegsRegisterClass(Inst, Op3, Address, Decoder);
+ }
+ return S;
+}
+
+static DecodeStatus
Decode2RUSInstruction(MCInst &Inst, unsigned Insn, uint64_t Address,
const void *Decoder) {
unsigned Op1, Op2, Op3;
OpenPOWER on IntegriCloud