OLD | NEW |
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 #if V8_TARGET_ARCH_MIPS64 | 10 #if V8_TARGET_ARCH_MIPS64 |
(...skipping 4007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4018 break; | 4018 break; |
4019 case BGEZ: | 4019 case BGEZ: |
4020 BranchHelper(rs >= 0); | 4020 BranchHelper(rs >= 0); |
4021 break; | 4021 break; |
4022 case BLTZAL: | 4022 case BLTZAL: |
4023 BranchAndLinkHelper(rs < 0); | 4023 BranchAndLinkHelper(rs < 0); |
4024 break; | 4024 break; |
4025 case BGEZAL: | 4025 case BGEZAL: |
4026 BranchAndLinkHelper(rs >= 0); | 4026 BranchAndLinkHelper(rs >= 0); |
4027 break; | 4027 break; |
| 4028 case DAHI: |
| 4029 SetResult(rs_reg, rs + (se_imm16 << 32)); |
| 4030 break; |
| 4031 case DATI: |
| 4032 SetResult(rs_reg, rs + (se_imm16 << 48)); |
| 4033 break; |
4028 default: | 4034 default: |
4029 UNREACHABLE(); | 4035 UNREACHABLE(); |
4030 } | 4036 } |
4031 break; // case REGIMM. | 4037 break; // case REGIMM. |
4032 // ------------- Branch instructions. | 4038 // ------------- Branch instructions. |
4033 // When comparing to zero, the encoding of rt field is always 0, so we don't | 4039 // When comparing to zero, the encoding of rt field is always 0, so we don't |
4034 // need to replace rt with zero. | 4040 // need to replace rt with zero. |
4035 case BEQ: | 4041 case BEQ: |
4036 BranchHelper(rs == rt); | 4042 BranchHelper(rs == rt); |
4037 break; | 4043 break; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4104 break; | 4110 break; |
4105 case ANDI: | 4111 case ANDI: |
4106 SetResult(rt_reg, rs & oe_imm16); | 4112 SetResult(rt_reg, rs & oe_imm16); |
4107 break; | 4113 break; |
4108 case ORI: | 4114 case ORI: |
4109 SetResult(rt_reg, rs | oe_imm16); | 4115 SetResult(rt_reg, rs | oe_imm16); |
4110 break; | 4116 break; |
4111 case XORI: | 4117 case XORI: |
4112 SetResult(rt_reg, rs ^ oe_imm16); | 4118 SetResult(rt_reg, rs ^ oe_imm16); |
4113 break; | 4119 break; |
4114 case LUI: { | 4120 case LUI: |
4115 int32_t alu32_out = static_cast<int32_t>(oe_imm16 << 16); | 4121 if (rs_reg != 0) { |
4116 // Sign-extend result of 32bit operation into 64bit register. | 4122 // AUI instruction. |
4117 SetResult(rt_reg, static_cast<int64_t>(alu32_out)); | 4123 DCHECK(kArchVariant == kMips64r6); |
| 4124 int32_t alu32_out = static_cast<int32_t>(rs + (se_imm16 << 16)); |
| 4125 SetResult(rt_reg, static_cast<int64_t>(alu32_out)); |
| 4126 } else { |
| 4127 // LUI instruction. |
| 4128 int32_t alu32_out = static_cast<int32_t>(oe_imm16 << 16); |
| 4129 // Sign-extend result of 32bit operation into 64bit register. |
| 4130 SetResult(rt_reg, static_cast<int64_t>(alu32_out)); |
| 4131 } |
4118 break; | 4132 break; |
4119 } | 4133 case DAUI: |
| 4134 DCHECK(kArchVariant == kMips64r6); |
| 4135 DCHECK(rs_reg != 0); |
| 4136 SetResult(rt_reg, rs + (se_imm16 << 16)); |
| 4137 break; |
4120 // ------------- Memory instructions. | 4138 // ------------- Memory instructions. |
4121 case LB: | 4139 case LB: |
4122 set_register(rt_reg, ReadB(rs + se_imm16)); | 4140 set_register(rt_reg, ReadB(rs + se_imm16)); |
4123 break; | 4141 break; |
4124 case LH: | 4142 case LH: |
4125 set_register(rt_reg, ReadH(rs + se_imm16, instr)); | 4143 set_register(rt_reg, ReadH(rs + se_imm16, instr)); |
4126 break; | 4144 break; |
4127 case LWL: { | 4145 case LWL: { |
4128 // al_offset is offset of the effective address within an aligned word. | 4146 // al_offset is offset of the effective address within an aligned word. |
4129 uint8_t al_offset = (rs + se_imm16) & kInt32AlignmentMask; | 4147 uint8_t al_offset = (rs + se_imm16) & kInt32AlignmentMask; |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4572 } | 4590 } |
4573 | 4591 |
4574 | 4592 |
4575 #undef UNSUPPORTED | 4593 #undef UNSUPPORTED |
4576 } // namespace internal | 4594 } // namespace internal |
4577 } // namespace v8 | 4595 } // namespace v8 |
4578 | 4596 |
4579 #endif // USE_SIMULATOR | 4597 #endif // USE_SIMULATOR |
4580 | 4598 |
4581 #endif // V8_TARGET_ARCH_MIPS64 | 4599 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |