mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-23 12:45:47 +00:00
[mips][microMIPSr6] Implement disassembler support
Implement disassembler support for microMIPS32r6. Differential Revision: http://reviews.llvm.org/D8490 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235307 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f30ac8f5ec
commit
fc4915076f
@ -837,10 +837,17 @@ DecodeStatus MipsDisassembler::getInstruction(MCInst &Instr, uint64_t &Size,
|
|||||||
if (Result == MCDisassembler::Fail)
|
if (Result == MCDisassembler::Fail)
|
||||||
return MCDisassembler::Fail;
|
return MCDisassembler::Fail;
|
||||||
|
|
||||||
DEBUG(dbgs() << "Trying MicroMips32 table (32-bit instructions):\n");
|
if (hasMips32r6()) {
|
||||||
// Calling the auto-generated decoder function.
|
DEBUG(dbgs() << "Trying MicroMips32r632 table (32-bit instructions):\n");
|
||||||
Result = decodeInstruction(DecoderTableMicroMips32, Instr, Insn, Address,
|
// Calling the auto-generated decoder function.
|
||||||
this, STI);
|
Result = decodeInstruction(DecoderTableMicroMips32r632, Instr, Insn, Address,
|
||||||
|
this, STI);
|
||||||
|
} else {
|
||||||
|
DEBUG(dbgs() << "Trying MicroMips32 table (32-bit instructions):\n");
|
||||||
|
// Calling the auto-generated decoder function.
|
||||||
|
Result = decodeInstruction(DecoderTableMicroMips32, Instr, Insn, Address,
|
||||||
|
this, STI);
|
||||||
|
}
|
||||||
if (Result != MCDisassembler::Fail) {
|
if (Result != MCDisassembler::Fail) {
|
||||||
Size = 4;
|
Size = 4;
|
||||||
return Result;
|
return Result;
|
||||||
|
@ -46,5 +46,7 @@ class BC_MMR6_DESC : BC_MMR6_DESC_BASE<"bc", brtarget26>;
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
let DecoderNamespace = "MicroMips32r6" in {
|
||||||
def BALC_MMR6 : R6MMR6Rel, BALC_MMR6_ENC, BALC_MMR6_DESC, ISA_MICROMIPS32R6;
|
def BALC_MMR6 : R6MMR6Rel, BALC_MMR6_ENC, BALC_MMR6_DESC, ISA_MICROMIPS32R6;
|
||||||
def BC_MMR6 : R6MMR6Rel, BC_MMR6_ENC, BC_MMR6_DESC, ISA_MICROMIPS32R6;
|
def BC_MMR6 : R6MMR6Rel, BC_MMR6_ENC, BC_MMR6_DESC, ISA_MICROMIPS32R6;
|
||||||
|
}
|
||||||
|
7
test/MC/Disassembler/Mips/micromips32r6.txt
Normal file
7
test/MC/Disassembler/Mips/micromips32r6.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# RUN: llvm-mc --disassemble %s -triple=mips-unknown-linux -mcpu=mips32r6 -mattr=micromips | FileCheck %s
|
||||||
|
|
||||||
|
# CHECK: balc 14572256
|
||||||
|
0xb4 0x37 0x96 0xb8
|
||||||
|
|
||||||
|
# CHECK: bc 14572256
|
||||||
|
0x94 0x37 0x96 0xb8
|
Loading…
x
Reference in New Issue
Block a user