aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-06-26 22:23:32 +0000
committerChad Rosier <mcrosier@apple.com>2013-06-26 22:23:32 +0000
commit096c0a03313ea43a1e4035645b02bf99fd35801a (patch)
tree5334cd1acef7a48b018c0d8f972845381ab975f7 /lib/Target
parent6b97ebe9a32342207b24a5f73ebbf3070ec8d189 (diff)
downloadexternal_llvm-096c0a03313ea43a1e4035645b02bf99fd35801a.zip
external_llvm-096c0a03313ea43a1e4035645b02bf99fd35801a.tar.gz
external_llvm-096c0a03313ea43a1e4035645b02bf99fd35801a.tar.bz2
[Mips Disassembler] Have the DecodeCCRRegisterClass function use the getReg
function to lookup the proper tablegen'ed register enumeration. Previously, it was using the encoded value directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185026 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/Mips/Disassembler/MipsDisassembler.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/Mips/Disassembler/MipsDisassembler.cpp b/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
index 4af6703..b6b265c 100644
--- a/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
+++ b/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
@@ -405,7 +405,10 @@ static DecodeStatus DecodeCCRRegisterClass(MCInst &Inst,
unsigned RegNo,
uint64_t Address,
const void *Decoder) {
- Inst.addOperand(MCOperand::CreateReg(RegNo));
+ if (RegNo > 31)
+ return MCDisassembler::Fail;
+ unsigned Reg = getReg(Decoder, Mips::CCRRegClassID, RegNo);
+ Inst.addOperand(MCOperand::CreateReg(Reg));
return MCDisassembler::Success;
}