diff options
author | Zoran Jovanovic <zoran.jovanovic@imgtec.com> | 2013-11-04 14:53:22 +0000 |
---|---|---|
committer | Zoran Jovanovic <zoran.jovanovic@imgtec.com> | 2013-11-04 14:53:22 +0000 |
commit | 5c042162beb3c2dd556e00aab84c4278a69cd5b1 (patch) | |
tree | a42a4d0608dae1d976c304d4bd2ecc4979a2d569 /lib/Target/Mips/Disassembler | |
parent | 6a907f8c7d6b440bbadaa9aaafb03b489673ae1f (diff) | |
download | llvm-5c042162beb3c2dd556e00aab84c4278a69cd5b1.tar.gz llvm-5c042162beb3c2dd556e00aab84c4278a69cd5b1.tar.bz2 llvm-5c042162beb3c2dd556e00aab84c4278a69cd5b1.tar.xz |
Support for microMIPS branch instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/Disassembler')
-rw-r--r-- | lib/Target/Mips/Disassembler/MipsDisassembler.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Target/Mips/Disassembler/MipsDisassembler.cpp b/lib/Target/Mips/Disassembler/MipsDisassembler.cpp index f9bf1aff5e..b890d3a887 100644 --- a/lib/Target/Mips/Disassembler/MipsDisassembler.cpp +++ b/lib/Target/Mips/Disassembler/MipsDisassembler.cpp @@ -205,6 +205,13 @@ static DecodeStatus DecodeJumpTarget(MCInst &Inst, uint64_t Address, const void *Decoder); +// DecodeBranchTargetMM - Decode microMIPS branch offset, which is +// shifted left by 1 bit. +static DecodeStatus DecodeBranchTargetMM(MCInst &Inst, + unsigned Offset, + uint64_t Address, + const void *Decoder); + // DecodeJumpTargetMM - Decode microMIPS jump target, which is // shifted left by 1 bit. static DecodeStatus DecodeJumpTargetMM(MCInst &Inst, @@ -751,6 +758,16 @@ static DecodeStatus DecodeJumpTarget(MCInst &Inst, return MCDisassembler::Success; } +static DecodeStatus DecodeBranchTargetMM(MCInst &Inst, + unsigned Offset, + uint64_t Address, + const void *Decoder) { + unsigned BranchOffset = Offset & 0xffff; + BranchOffset = SignExtend32<18>(BranchOffset << 1); + Inst.addOperand(MCOperand::CreateImm(BranchOffset)); + return MCDisassembler::Success; +} + static DecodeStatus DecodeJumpTargetMM(MCInst &Inst, unsigned Insn, uint64_t Address, |