OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/base/division-by-constant.h" | 9 #include "src/base/division-by-constant.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 if (kArchVariant == kMips64r6 && sa <= 4) { | 1325 if (kArchVariant == kMips64r6 && sa <= 4) { |
1326 dlsa(rd, rt, rs, sa - 1); | 1326 dlsa(rd, rt, rs, sa - 1); |
1327 } else { | 1327 } else { |
1328 Register tmp = rd.is(rt) ? scratch : rd; | 1328 Register tmp = rd.is(rt) ? scratch : rd; |
1329 DCHECK(!tmp.is(rt)); | 1329 DCHECK(!tmp.is(rt)); |
1330 dsll(tmp, rs, sa); | 1330 dsll(tmp, rs, sa); |
1331 Daddu(rd, rt, tmp); | 1331 Daddu(rd, rt, tmp); |
1332 } | 1332 } |
1333 } | 1333 } |
1334 | 1334 |
| 1335 void MacroAssembler::Bovc(Register rs, Register rt, Label* L) { |
| 1336 if (is_trampoline_emitted()) { |
| 1337 Label skip; |
| 1338 bnvc(rs, rt, &skip); |
| 1339 BranchLong(L, PROTECT); |
| 1340 bind(&skip); |
| 1341 } else { |
| 1342 bovc(rs, rt, L); |
| 1343 } |
| 1344 } |
| 1345 |
| 1346 void MacroAssembler::Bnvc(Register rs, Register rt, Label* L) { |
| 1347 if (is_trampoline_emitted()) { |
| 1348 Label skip; |
| 1349 bovc(rs, rt, &skip); |
| 1350 BranchLong(L, PROTECT); |
| 1351 bind(&skip); |
| 1352 } else { |
| 1353 bnvc(rs, rt, L); |
| 1354 } |
| 1355 } |
1335 | 1356 |
1336 // ------------Pseudo-instructions------------- | 1357 // ------------Pseudo-instructions------------- |
1337 | 1358 |
1338 // Change endianness | 1359 // Change endianness |
1339 void MacroAssembler::ByteSwapSigned(Register reg, int operand_size) { | 1360 void MacroAssembler::ByteSwapSigned(Register reg, int operand_size) { |
1340 DCHECK(operand_size == 1 || operand_size == 2 || operand_size == 4 || | 1361 DCHECK(operand_size == 1 || operand_size == 2 || operand_size == 4 || |
1341 operand_size == 8); | 1362 operand_size == 8); |
1342 DCHECK(kArchVariant == kMips64r6 || kArchVariant == kMips64r2); | 1363 DCHECK(kArchVariant == kMips64r6 || kArchVariant == kMips64r2); |
1343 if (operand_size == 1) { | 1364 if (operand_size == 1) { |
1344 seb(reg, reg); | 1365 seb(reg, reg); |
(...skipping 4254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5599 if (!overflow_label) { | 5620 if (!overflow_label) { |
5600 DCHECK(no_overflow_label); | 5621 DCHECK(no_overflow_label); |
5601 DCHECK(!dst.is(scratch)); | 5622 DCHECK(!dst.is(scratch)); |
5602 Register left_reg = left.is(dst) ? scratch : left; | 5623 Register left_reg = left.is(dst) ? scratch : left; |
5603 Register right_reg = right.is(dst) ? t9 : right; | 5624 Register right_reg = right.is(dst) ? t9 : right; |
5604 DCHECK(!dst.is(left_reg)); | 5625 DCHECK(!dst.is(left_reg)); |
5605 DCHECK(!dst.is(right_reg)); | 5626 DCHECK(!dst.is(right_reg)); |
5606 Move(left_reg, left); | 5627 Move(left_reg, left); |
5607 Move(right_reg, right); | 5628 Move(right_reg, right); |
5608 addu(dst, left, right); | 5629 addu(dst, left, right); |
5609 bnvc(left_reg, right_reg, no_overflow_label); | 5630 Bnvc(left_reg, right_reg, no_overflow_label); |
5610 } else { | 5631 } else { |
5611 bovc(left, right, overflow_label); | 5632 Bovc(left, right, overflow_label); |
5612 addu(dst, left, right); | 5633 addu(dst, left, right); |
5613 if (no_overflow_label) bc(no_overflow_label); | 5634 if (no_overflow_label) bc(no_overflow_label); |
5614 } | 5635 } |
5615 } else { | 5636 } else { |
5616 Register overflow_dst = t9; | 5637 Register overflow_dst = t9; |
5617 DCHECK(!dst.is(scratch)); | 5638 DCHECK(!dst.is(scratch)); |
5618 DCHECK(!dst.is(overflow_dst)); | 5639 DCHECK(!dst.is(overflow_dst)); |
5619 DCHECK(!scratch.is(overflow_dst)); | 5640 DCHECK(!scratch.is(overflow_dst)); |
5620 DCHECK(!left.is(overflow_dst)); | 5641 DCHECK(!left.is(overflow_dst)); |
5621 DCHECK(!right.is(overflow_dst)); | 5642 DCHECK(!right.is(overflow_dst)); |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7337 if (mag.shift > 0) sra(result, result, mag.shift); | 7358 if (mag.shift > 0) sra(result, result, mag.shift); |
7338 srl(at, dividend, 31); | 7359 srl(at, dividend, 31); |
7339 Addu(result, result, Operand(at)); | 7360 Addu(result, result, Operand(at)); |
7340 } | 7361 } |
7341 | 7362 |
7342 | 7363 |
7343 } // namespace internal | 7364 } // namespace internal |
7344 } // namespace v8 | 7365 } // namespace v8 |
7345 | 7366 |
7346 #endif // V8_TARGET_ARCH_MIPS64 | 7367 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |