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

Unified Diff: runtime/vm/simulator_arm64.cc

Issue 2639693002: VM: Fix umulh on simarm64 Windows. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_arm64.cc
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index 4e8fde227829e2ce610d177a28560e77c516865c..f502c101623de3fb8ec6d1bb27eb523eb1e2b29c 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -2261,7 +2261,8 @@ int64_t Simulator::ShiftOperand(uint8_t reg_size,
value &= kWRegMask;
}
return (static_cast<uint64_t>(value) >> amount) |
- ((value & ((1L << amount) - 1L)) << (reg_size - amount));
+ ((static_cast<uint64_t>(value) & ((1ULL << amount) - 1ULL))
+ << (reg_size - amount));
}
default:
UNIMPLEMENTED();
@@ -2673,8 +2674,8 @@ void Simulator::DecodeMiscDP3Source(Instr* instr) {
const uint64_t rm_val = get_register(rm, R31IsZR);
#if defined(TARGET_OS_WINDOWS)
// Visual Studio does not support __int128.
- int64_t alu_out;
- Multiply128(rn_val, rm_val, &alu_out);
+ uint64_t alu_out;
+ UnsignedMultiply128(rn_val, rm_val, &alu_out);
#else
const __int128 res =
static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val);
zra 2017/01/17 20:18:04 Is this one signed or unsigned?
Florian Schneider 2017/01/17 21:16:47 I'll add unsigned here as well. The code generated
« 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