OLD | NEW |
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 "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
7 | 7 |
8 // Only build the simulator if not compiling for real MIPS hardware. | 8 // Only build the simulator if not compiling for real MIPS hardware. |
9 #if !defined(HOST_ARCH_MIPS) | 9 #if !defined(HOST_ARCH_MIPS) |
10 | 10 |
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 | 1023 |
1024 void Simulator::DecodeRegImm(Instr* instr) { | 1024 void Simulator::DecodeRegImm(Instr* instr) { |
1025 ASSERT(instr->OpcodeField() == REGIMM); | 1025 ASSERT(instr->OpcodeField() == REGIMM); |
1026 switch (instr->RegImmFnField()) { | 1026 switch (instr->RegImmFnField()) { |
1027 case BGEZ: { | 1027 case BGEZ: { |
1028 // Format(instr, "bgez 'rs, 'dest"); | 1028 // Format(instr, "bgez 'rs, 'dest"); |
1029 int32_t rs_val = get_register(instr->RsField()); | 1029 int32_t rs_val = get_register(instr->RsField()); |
1030 DoBranch(instr, rs_val >= 0, false); | 1030 DoBranch(instr, rs_val >= 0, false); |
1031 break; | 1031 break; |
1032 } | 1032 } |
| 1033 case BGEZAL: { |
| 1034 int32_t rs_val = get_register(instr->RsField()); |
| 1035 // Return address is one after the delay slot. |
| 1036 set_register(RA, pc_ + (2*Instr::kInstrSize)); |
| 1037 DoBranch(instr, rs_val >= 0, false); |
| 1038 break; |
| 1039 } |
1033 case BGEZL: { | 1040 case BGEZL: { |
1034 // Format(instr, "bgezl 'rs, 'dest"); | 1041 // Format(instr, "bgezl 'rs, 'dest"); |
1035 int32_t rs_val = get_register(instr->RsField()); | 1042 int32_t rs_val = get_register(instr->RsField()); |
1036 DoBranch(instr, rs_val >= 0, true); | 1043 DoBranch(instr, rs_val >= 0, true); |
1037 break; | 1044 break; |
1038 } | 1045 } |
1039 case BLTZ: { | 1046 case BLTZ: { |
1040 // Format(instr, "bltz 'rs, 'dest"); | 1047 // Format(instr, "bltz 'rs, 'dest"); |
1041 int32_t rs_val = get_register(instr->RsField()); | 1048 int32_t rs_val = get_register(instr->RsField()); |
1042 DoBranch(instr, rs_val < 0, false); | 1049 DoBranch(instr, rs_val < 0, false); |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 // Restore the SP register and return R1:R0. | 1402 // Restore the SP register and return R1:R0. |
1396 set_register(SP, sp_before_call); | 1403 set_register(SP, sp_before_call); |
1397 return Utils::LowHighTo64Bits(get_register(V0), get_register(V1)); | 1404 return Utils::LowHighTo64Bits(get_register(V0), get_register(V1)); |
1398 } | 1405 } |
1399 | 1406 |
1400 } // namespace dart | 1407 } // namespace dart |
1401 | 1408 |
1402 #endif // !defined(HOST_ARCH_MIPS) | 1409 #endif // !defined(HOST_ARCH_MIPS) |
1403 | 1410 |
1404 #endif // defined TARGET_ARCH_MIPS | 1411 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |