summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/Disassembler
diff options
context:
space:
mode:
authorZoran Jovanovic <zoran.jovanovic@imgtec.com>2014-05-16 11:03:45 +0000
committerZoran Jovanovic <zoran.jovanovic@imgtec.com>2014-05-16 11:03:45 +0000
commit3c8869dc6aaa3737b48210bc679899e5b065a161 (patch)
treed07fc43fe11ff19b72594a5559230441d78b5238 /llvm/lib/Target/Mips/Disassembler
parentfa6820a035b98c52c251768611ac4470b036a28f (diff)
downloadbcm5719-llvm-3c8869dc6aaa3737b48210bc679899e5b065a161.tar.gz
bcm5719-llvm-3c8869dc6aaa3737b48210bc679899e5b065a161.zip
[mips][mips64r6] Add compact branch instructions
Differential Revision: http://reviews.llvm.org/D3691 llvm-svn: 208974
Diffstat (limited to 'llvm/lib/Target/Mips/Disassembler')
-rw-r--r--llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp b/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
index 958712602b4..21abe6c5857 100644
--- a/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
+++ b/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
@@ -205,6 +205,16 @@ static DecodeStatus DecodeJumpTarget(MCInst &Inst,
uint64_t Address,
const void *Decoder);
+static DecodeStatus DecodeBranchTarget21(MCInst &Inst,
+ unsigned Offset,
+ uint64_t Address,
+ const void *Decoder);
+
+static DecodeStatus DecodeBranchTarget26(MCInst &Inst,
+ unsigned Offset,
+ uint64_t Address,
+ const void *Decoder);
+
// DecodeBranchTargetMM - Decode microMIPS branch offset, which is
// shifted left by 1 bit.
static DecodeStatus DecodeBranchTargetMM(MCInst &Inst,
@@ -856,6 +866,26 @@ static DecodeStatus DecodeJumpTarget(MCInst &Inst,
return MCDisassembler::Success;
}
+static DecodeStatus DecodeBranchTarget21(MCInst &Inst,
+ unsigned Offset,
+ uint64_t Address,
+ const void *Decoder) {
+ int32_t BranchOffset = SignExtend32<21>(Offset) << 2;
+
+ Inst.addOperand(MCOperand::CreateImm(BranchOffset));
+ return MCDisassembler::Success;
+}
+
+static DecodeStatus DecodeBranchTarget26(MCInst &Inst,
+ unsigned Offset,
+ uint64_t Address,
+ const void *Decoder) {
+ int32_t BranchOffset = SignExtend32<26>(Offset) << 2;
+
+ Inst.addOperand(MCOperand::CreateImm(BranchOffset));
+ return MCDisassembler::Success;
+}
+
static DecodeStatus DecodeBranchTargetMM(MCInst &Inst,
unsigned Offset,
uint64_t Address,
OpenPOWER on IntegriCloud