Skip to content

Commit

Permalink
riscv64: Add basic disassembler.
Browse files Browse the repository at this point in the history
Add a disassembler that differentiates between 16-bit and
32-bit instructions and disassembles 32-bit LUI, AUIPC,
branches, loads, stores and integral arithmetic operations.

Test: m dump-oat  # and manually inspect output
Bug: 283082089
Change-Id: I0946aaf2bb99d5539efbcecabc111def2a512439
  • Loading branch information
vmarko committed Jul 31, 2023
1 parent 087224a commit 06f1fc0
Show file tree
Hide file tree
Showing 4 changed files with 636 additions and 0 deletions.
3 changes: 3 additions & 0 deletions disassembler/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ art_cc_defaults {
arm64: {
srcs: ["disassembler_arm64.cc"],
},
riscv64: {
srcs: ["disassembler_riscv64.cc"],
},
x86: {
srcs: ["disassembler_x86.cc"],
},
Expand Down
8 changes: 8 additions & 0 deletions disassembler/disassembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
# include "disassembler_arm64.h"
#endif

#ifdef ART_ENABLE_CODEGEN_riscv64
# include "disassembler_riscv64.h"
#endif

#if defined(ART_ENABLE_CODEGEN_x86) || defined(ART_ENABLE_CODEGEN_x86_64)
# include "disassembler_x86.h"
#endif
Expand All @@ -53,6 +57,10 @@ Disassembler* Disassembler::Create(InstructionSet instruction_set, DisassemblerO
case InstructionSet::kArm64:
return new arm64::DisassemblerArm64(options);
#endif
#ifdef ART_ENABLE_CODEGEN_riscv64
case InstructionSet::kRiscv64:
return new riscv64::DisassemblerRiscv64(options);
#endif
#ifdef ART_ENABLE_CODEGEN_x86
case InstructionSet::kX86:
return new x86::DisassemblerX86(options, /* supports_rex= */ false);
Expand Down
Loading

0 comments on commit 06f1fc0

Please sign in to comment.