aboutsummaryrefslogtreecommitdiff
path: root/riscv/disasm.h
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2016-06-29 15:00:22 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2016-06-29 15:02:12 -0700
commit03b8bad375217fbc2143046e8caad9d80301abdb (patch)
treea5649fae5b7eb88825a5f94181820e4affff67b8 /riscv/disasm.h
parent9b960e91b4d7e44d59fd73a7199517a82ba07c86 (diff)
downloadspike-03b8bad375217fbc2143046e8caad9d80301abdb.zip
spike-03b8bad375217fbc2143046e8caad9d80301abdb.tar.gz
spike-03b8bad375217fbc2143046e8caad9d80301abdb.tar.bz2
Disassemble RVC instructions based on XLEN
The interpretation of RVC opcodes depends on XLEN, and the disassembler always assumed RV32. h/t Michael Clark
Diffstat (limited to 'riscv/disasm.h')
-rw-r--r--riscv/disasm.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/riscv/disasm.h b/riscv/disasm.h
index a8da066..e2981d4 100644
--- a/riscv/disasm.h
+++ b/riscv/disasm.h
@@ -60,14 +60,14 @@ class disasm_insn_t
class disassembler_t
{
public:
- disassembler_t();
+ disassembler_t(int xlen);
~disassembler_t();
- std::string disassemble(insn_t insn);
+ std::string disassemble(insn_t insn) const;
void add_insn(disasm_insn_t* insn);
private:
static const int HASH_SIZE = 256;
std::vector<const disasm_insn_t*> chain[HASH_SIZE+1];
- const disasm_insn_t* lookup(insn_t insn);
+ const disasm_insn_t* lookup(insn_t insn) const;
};
#endif