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

Side by Side Diff: runtime/vm/simulator_mips.cc

Issue 18141002: Fixes a bug in the mips Random_nextState intrinsic. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include <math.h> // for isnan. 5 #include <math.h> // for isnan.
6 #include <setjmp.h> 6 #include <setjmp.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #if defined(TARGET_ARCH_MIPS) 10 #if defined(TARGET_ARCH_MIPS)
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 void Simulator::DecodeSpecial2(Instr* instr) { 1387 void Simulator::DecodeSpecial2(Instr* instr) {
1388 ASSERT(instr->OpcodeField() == SPECIAL2); 1388 ASSERT(instr->OpcodeField() == SPECIAL2);
1389 switch (instr->FunctionField()) { 1389 switch (instr->FunctionField()) {
1390 case MADD: { 1390 case MADD: {
1391 ASSERT(instr->RdField() == 0); 1391 ASSERT(instr->RdField() == 0);
1392 ASSERT(instr->SaField() == 0); 1392 ASSERT(instr->SaField() == 0);
1393 // Format(instr, "madd 'rs, 'rt"); 1393 // Format(instr, "madd 'rs, 'rt");
1394 uint32_t lo = get_lo_register(); 1394 uint32_t lo = get_lo_register();
1395 int32_t hi = get_hi_register(); 1395 int32_t hi = get_hi_register();
1396 int64_t accum = Utils::LowHighTo64Bits(lo, hi); 1396 int64_t accum = Utils::LowHighTo64Bits(lo, hi);
1397 int64_t rs = static_cast<int64_t>(get_register(instr->RsField())); 1397 int64_t rs = get_register(instr->RsField());
1398 int64_t rt = static_cast<int64_t>(get_register(instr->RtField())); 1398 int64_t rt = get_register(instr->RtField());
1399 int64_t res = accum + rs * rt; 1399 int64_t res = accum + rs * rt;
1400 set_hi_register(Utils::High32Bits(res)); 1400 set_hi_register(Utils::High32Bits(res));
1401 set_lo_register(Utils::Low32Bits(res)); 1401 set_lo_register(Utils::Low32Bits(res));
1402 break; 1402 break;
1403 } 1403 }
1404 case MADDU: { 1404 case MADDU: {
1405 ASSERT(instr->RdField() == 0); 1405 ASSERT(instr->RdField() == 0);
1406 ASSERT(instr->SaField() == 0); 1406 ASSERT(instr->SaField() == 0);
1407 // Format(instr, "maddu 'rs, 'rt"); 1407 // Format(instr, "maddu 'rs, 'rt");
1408 uint32_t lo = get_lo_register(); 1408 uint32_t lo = get_lo_register();
1409 uint32_t hi = get_hi_register(); 1409 uint32_t hi = get_hi_register();
1410 uint64_t accum = Utils::LowHighTo64Bits(lo, hi); 1410 uint64_t accum = Utils::LowHighTo64Bits(lo, hi);
1411 uint64_t rs = static_cast<uint64_t>(get_register(instr->RsField())); 1411 uint64_t rs = static_cast<uint32_t>(get_register(instr->RsField()));
1412 uint64_t rt = static_cast<uint64_t>(get_register(instr->RtField())); 1412 uint64_t rt = static_cast<uint32_t>(get_register(instr->RtField()));
1413 uint64_t res = accum + rs * rt; 1413 uint64_t res = accum + rs * rt;
1414 set_hi_register(Utils::High32Bits(res)); 1414 set_hi_register(Utils::High32Bits(res));
1415 set_lo_register(Utils::Low32Bits(res)); 1415 set_lo_register(Utils::Low32Bits(res));
1416 break; 1416 break;
1417 } 1417 }
1418 case CLO: { 1418 case CLO: {
1419 ASSERT(instr->SaField() == 0); 1419 ASSERT(instr->SaField() == 0);
1420 ASSERT(instr->RtField() == instr->RdField()); 1420 ASSERT(instr->RtField() == instr->RdField());
1421 // Format(instr, "clo 'rd, 'rs"); 1421 // Format(instr, "clo 'rd, 'rs");
1422 int32_t rs_val = get_register(instr->RsField()); 1422 int32_t rs_val = get_register(instr->RsField());
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
2228 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); 2228 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
2229 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); 2229 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
2230 buf->Longjmp(); 2230 buf->Longjmp();
2231 } 2231 }
2232 2232
2233 } // namespace dart 2233 } // namespace dart
2234 2234
2235 #endif // !defined(HOST_ARCH_MIPS) 2235 #endif // !defined(HOST_ARCH_MIPS)
2236 2236
2237 #endif // defined TARGET_ARCH_MIPS 2237 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698