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

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

Issue 2769403002: MIPS64: Fix code generator and simulator for DEXTM. (Closed)
Patch Set: Created 3 years, 9 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/mips64/disasm-mips64.cc ('k') | 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 dc44f088c992364271ac55a64afde576c3185db3..7ec51b1cfed4d466c584b0c59387abdd98a7dbe8 100644
--- a/src/mips64/simulator-mips64.cc
+++ b/src/mips64/simulator-mips64.cc
@@ -4072,7 +4072,7 @@ void Simulator::DecodeTypeRegisterSPECIAL3() {
// Interpret sa field as 5-bit lsb of extract.
uint16_t lsb = sa();
uint16_t size = msb + 1;
- uint64_t mask = (1ULL << size) - 1;
+ uint64_t mask = (size == 64) ? UINT64_MAX : (1ULL << size) - 1;
alu_out = static_cast<int64_t>((rs_u() & (mask << lsb)) >> lsb);
SetResult(rt_reg(), alu_out);
break;
@@ -4083,7 +4083,7 @@ void Simulator::DecodeTypeRegisterSPECIAL3() {
// Interpret sa field as 5-bit lsb of extract.
uint16_t lsb = sa();
uint16_t size = msb + 33;
- uint64_t mask = (1ULL << size) - 1;
+ uint64_t mask = (size == 64) ? UINT64_MAX : (1ULL << size) - 1;
alu_out = static_cast<int64_t>((rs_u() & (mask << lsb)) >> lsb);
SetResult(rt_reg(), alu_out);
break;
@@ -4094,7 +4094,7 @@ void Simulator::DecodeTypeRegisterSPECIAL3() {
// Interpret sa field as 5-bit lsb of extract.
uint16_t lsb = sa() + 32;
uint16_t size = msb + 1;
- uint64_t mask = (1ULL << size) - 1;
+ uint64_t mask = (size == 64) ? UINT64_MAX : (1ULL << size) - 1;
alu_out = static_cast<int64_t>((rs_u() & (mask << lsb)) >> lsb);
SetResult(rt_reg(), alu_out);
break;
« no previous file with comments | « src/mips64/disasm-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698