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

Side by Side 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 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> 5 #include <limits.h>
6 #include <stdarg.h> 6 #include <stdarg.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "src/v8.h" 10 #include "src/v8.h"
(...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after
2073 } else { 2073 } else {
2074 // MIPS spec: If no bits were set in GPR rs, the result written to 2074 // MIPS spec: If no bits were set in GPR rs, the result written to
2075 // GPR rd is 32. 2075 // GPR rd is 32.
2076 DCHECK(instr->SaValue() == 1); 2076 DCHECK(instr->SaValue() == 1);
2077 *alu_out = base::bits::CountLeadingZeros32(rs_u); 2077 *alu_out = base::bits::CountLeadingZeros32(rs_u);
2078 } 2078 }
2079 break; 2079 break;
2080 case MFLO: 2080 case MFLO:
2081 *alu_out = get_register(LO); 2081 *alu_out = get_register(LO);
2082 break; 2082 break;
2083 case MULT: // MULT == D_MUL_MUH. 2083 case MULT: { // MULT == D_MUL_MUH.
2084 // TODO(plind) - Unify MULT/DMULT with single set of 64-bit HI/Lo 2084 int32_t rs_lo = static_cast<int32_t>(rs);
2085 // regs. 2085 int32_t rt_lo = static_cast<int32_t>(rt);
2086 // TODO(plind) - make the 32-bit MULT ops conform to spec regarding 2086 *i64hilo = static_cast<int64_t>(rs_lo) * static_cast<int64_t>(rt_lo);
2087 // checking of 32-bit input values, and un-define operations of HW.
2088 *i64hilo = rs * rt;
2089 break; 2087 break;
2088 }
2090 case MULTU: 2089 case MULTU:
2091 *u64hilo = static_cast<uint64_t>(rs_u & 0xffffffff) * 2090 *u64hilo = static_cast<uint64_t>(rs_u & 0xffffffff) *
2092 static_cast<uint64_t>(rt_u & 0xffffffff); 2091 static_cast<uint64_t>(rt_u & 0xffffffff);
2093 break; 2092 break;
2094 case DMULT: // DMULT == D_MUL_MUH. 2093 case DMULT: // DMULT == D_MUL_MUH.
2095 if (kArchVariant != kMips64r6) { 2094 if (kArchVariant != kMips64r6) {
2096 *i128resultH = MultiplyHighSigned(rs, rt); 2095 *i128resultH = MultiplyHighSigned(rs, rt);
2097 *i128resultL = rs * rt; 2096 *i128resultL = rs * rt;
2098 } else { 2097 } else {
2099 switch (instr->SaValue()) { 2098 switch (instr->SaValue()) {
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
3448 } 3447 }
3449 3448
3450 3449
3451 #undef UNSUPPORTED 3450 #undef UNSUPPORTED
3452 3451
3453 } } // namespace v8::internal 3452 } } // namespace v8::internal
3454 3453
3455 #endif // USE_SIMULATOR 3454 #endif // USE_SIMULATOR
3456 3455
3457 #endif // V8_TARGET_ARCH_MIPS64 3456 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« 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