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

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

Issue 756073003: MIPS64: Fix MULT in simulator to conform the spec. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/simulator-mips64.cc
diff --git a/src/mips64/simulator-mips64.cc b/src/mips64/simulator-mips64.cc
index 3351ac179fff73aee571e3a3042b1441e4f8d761..9899d47a0e5ec940d99bf1514827f6f57f2187f9 100644
--- a/src/mips64/simulator-mips64.cc
+++ b/src/mips64/simulator-mips64.cc
@@ -2080,13 +2080,12 @@ void Simulator::ConfigureTypeRegister(Instruction* instr,
case MFLO:
*alu_out = get_register(LO);
break;
- case MULT: // MULT == D_MUL_MUH.
- // TODO(plind) - Unify MULT/DMULT with single set of 64-bit HI/Lo
- // regs.
- // TODO(plind) - make the 32-bit MULT ops conform to spec regarding
- // checking of 32-bit input values, and un-define operations of HW.
- *i64hilo = rs * rt;
+ case MULT: { // MULT == D_MUL_MUH.
+ int32_t rs_lo = static_cast<int32_t>(rs);
+ int32_t rt_lo = static_cast<int32_t>(rt);
+ *i64hilo = static_cast<int64_t>(rs_lo) * static_cast<int64_t>(rt_lo);
break;
+ }
case MULTU:
*u64hilo = static_cast<uint64_t>(rs_u & 0xffffffff) *
static_cast<uint64_t>(rt_u & 0xffffffff);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698