Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(530)

Unified Diff: src/mips64/disasm-mips64.cc

Issue 1258743004: MIPS: Fix disassembler for J and JAL instructions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix disassembler for J and JAL. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/disasm-mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/disasm-mips64.cc
diff --git a/src/mips64/disasm-mips64.cc b/src/mips64/disasm-mips64.cc
index 0723190871959b507fff262f81c63f36a93ac270..a723bdc7702bc7f088e4f45c3c393cd2b9ef197e 100644
--- a/src/mips64/disasm-mips64.cc
+++ b/src/mips64/disasm-mips64.cc
@@ -344,8 +344,10 @@ void Decoder::PrintPCImm21(Instruction* instr, int delta_pc, int n_bits) {
// Print 26-bit hex immediate value.
void Decoder::PrintXImm26(Instruction* instr) {
- uint32_t imm = static_cast<uint32_t>(instr->Imm26Value()) << kImmFieldShift;
- out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", imm);
+ uint64_t target = static_cast<uint64_t>(instr->Imm26Value())
+ << kImmFieldShift;
+ target = (reinterpret_cast<uint64_t>(instr) & ~0xfffffff) | target;
+ out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%lx", target);
}
« no previous file with comments | « src/mips/disasm-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698