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 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1541 | 1541 |
1542 bind(&msb_clear); | 1542 bind(&msb_clear); |
1543 // Rs < 2^63, we can do simple conversion. | 1543 // Rs < 2^63, we can do simple conversion. |
1544 dmtc1(rs, fd); | 1544 dmtc1(rs, fd); |
1545 cvt_d_l(fd, fd); | 1545 cvt_d_l(fd, fd); |
1546 | 1546 |
1547 bind(&conversion_done); | 1547 bind(&conversion_done); |
1548 } | 1548 } |
1549 | 1549 |
1550 | 1550 |
| 1551 void MacroAssembler::Cvt_s_ul(FPURegister fd, FPURegister fs) { |
| 1552 // Move the data from fs to t8. |
| 1553 dmfc1(t8, fs); |
| 1554 Cvt_s_ul(fd, t8); |
| 1555 } |
| 1556 |
| 1557 |
| 1558 void MacroAssembler::Cvt_s_ul(FPURegister fd, Register rs) { |
| 1559 // Convert rs to a FP value in fd. |
| 1560 |
| 1561 DCHECK(!rs.is(t9)); |
| 1562 DCHECK(!rs.is(at)); |
| 1563 |
| 1564 Label positive, conversion_done; |
| 1565 |
| 1566 Branch(&positive, ge, rs, Operand(zero_reg)); |
| 1567 |
| 1568 // Rs >= 2^31. |
| 1569 andi(t9, rs, 1); |
| 1570 dsrl(rs, rs, 1); |
| 1571 or_(t9, t9, rs); |
| 1572 dmtc1(t9, fd); |
| 1573 cvt_s_l(fd, fd); |
| 1574 Branch(USE_DELAY_SLOT, &conversion_done); |
| 1575 add_s(fd, fd, fd); // In delay slot. |
| 1576 |
| 1577 bind(&positive); |
| 1578 // Rs < 2^31, we can do simple conversion. |
| 1579 dmtc1(rs, fd); |
| 1580 cvt_s_l(fd, fd); |
| 1581 |
| 1582 bind(&conversion_done); |
| 1583 } |
| 1584 |
| 1585 |
1551 void MacroAssembler::Round_l_d(FPURegister fd, FPURegister fs) { | 1586 void MacroAssembler::Round_l_d(FPURegister fd, FPURegister fs) { |
1552 round_l_d(fd, fs); | 1587 round_l_d(fd, fs); |
1553 } | 1588 } |
1554 | 1589 |
1555 | 1590 |
1556 void MacroAssembler::Floor_l_d(FPURegister fd, FPURegister fs) { | 1591 void MacroAssembler::Floor_l_d(FPURegister fd, FPURegister fs) { |
1557 floor_l_d(fd, fs); | 1592 floor_l_d(fd, fs); |
1558 } | 1593 } |
1559 | 1594 |
1560 | 1595 |
(...skipping 4641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6202 if (mag.shift > 0) sra(result, result, mag.shift); | 6237 if (mag.shift > 0) sra(result, result, mag.shift); |
6203 srl(at, dividend, 31); | 6238 srl(at, dividend, 31); |
6204 Addu(result, result, Operand(at)); | 6239 Addu(result, result, Operand(at)); |
6205 } | 6240 } |
6206 | 6241 |
6207 | 6242 |
6208 } // namespace internal | 6243 } // namespace internal |
6209 } // namespace v8 | 6244 } // namespace v8 |
6210 | 6245 |
6211 #endif // V8_TARGET_ARCH_MIPS64 | 6246 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |