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

Side by Side Diff: src/mips64/macro-assembler-mips64.cc

Issue 1463193002: MIPS64: [turbofan] Implemented the TruncateFloat64ToUint64 TurboFan operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo. Created 5 years, 1 month 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
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 } 1616 }
1617 1617
1618 1618
1619 void MacroAssembler::Trunc_uw_d(FPURegister fd, 1619 void MacroAssembler::Trunc_uw_d(FPURegister fd,
1620 FPURegister fs, 1620 FPURegister fs,
1621 FPURegister scratch) { 1621 FPURegister scratch) {
1622 Trunc_uw_d(fs, t8, scratch); 1622 Trunc_uw_d(fs, t8, scratch);
1623 mtc1(t8, fd); 1623 mtc1(t8, fd);
1624 } 1624 }
1625 1625
1626 void MacroAssembler::Trunc_ul_d(FPURegister fd, FPURegister fs,
1627 FPURegister scratch) {
1628 Trunc_ul_d(fs, t8, scratch);
1629 dmtc1(t8, fd);
1630 }
1631
1626 1632
1627 void MacroAssembler::Trunc_w_d(FPURegister fd, FPURegister fs) { 1633 void MacroAssembler::Trunc_w_d(FPURegister fd, FPURegister fs) {
1628 trunc_w_d(fd, fs); 1634 trunc_w_d(fd, fs);
1629 } 1635 }
1630 1636
1631 1637
1632 void MacroAssembler::Round_w_d(FPURegister fd, FPURegister fs) { 1638 void MacroAssembler::Round_w_d(FPURegister fd, FPURegister fs) {
1633 round_w_d(fd, fs); 1639 round_w_d(fd, fs);
1634 } 1640 }
1635 1641
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 Branch(&done); 1676 Branch(&done);
1671 // Simple conversion. 1677 // Simple conversion.
1672 bind(&simple_convert); 1678 bind(&simple_convert);
1673 trunc_w_d(scratch, fd); 1679 trunc_w_d(scratch, fd);
1674 mfc1(rs, scratch); 1680 mfc1(rs, scratch);
1675 1681
1676 bind(&done); 1682 bind(&done);
1677 } 1683 }
1678 1684
1679 1685
1686 void MacroAssembler::Trunc_ul_d(FPURegister fd, Register rs,
1687 FPURegister scratch) {
1688 DCHECK(!fd.is(scratch));
1689 DCHECK(!rs.is(at));
1690
1691 // Load 2^63 into scratch as its float representation.
1692 li(at, 0x43e0000000000000);
1693 dmtc1(at, scratch);
1694
1695 // Test if scratch > fd.
1696 // If fd < 2^63 we can convert it normally.
1697 Label simple_convert, done;
1698 BranchF(&simple_convert, NULL, lt, fd, scratch);
1699
1700 // First we subtract 2^63 from fd, then trunc it to rs
1701 // and add 2^63 to rs.
1702 sub_d(scratch, fd, scratch);
1703 trunc_l_d(scratch, scratch);
1704 dmfc1(rs, scratch);
1705 Or(rs, rs, Operand(1UL << 63));
Alan Li 2015/11/20 13:35:22 maybe splitting the Or into LI and ORI, and put OR
1706 Branch(&done);
1707
1708 // Simple conversion.
1709 bind(&simple_convert);
1710 trunc_l_d(scratch, fd);
1711 dmfc1(rs, scratch);
1712
1713 bind(&done);
1714 }
1715
1716
1680 void MacroAssembler::Madd_d(FPURegister fd, FPURegister fr, FPURegister fs, 1717 void MacroAssembler::Madd_d(FPURegister fd, FPURegister fr, FPURegister fs,
1681 FPURegister ft, FPURegister scratch) { 1718 FPURegister ft, FPURegister scratch) {
1682 if (0) { // TODO(plind): find reasonable arch-variant symbol names. 1719 if (0) { // TODO(plind): find reasonable arch-variant symbol names.
1683 madd_d(fd, fr, fs, ft); 1720 madd_d(fd, fr, fs, ft);
1684 } else { 1721 } else {
1685 // Can not change source regs's value. 1722 // Can not change source regs's value.
1686 DCHECK(!fr.is(scratch) && !fs.is(scratch) && !ft.is(scratch)); 1723 DCHECK(!fr.is(scratch) && !fs.is(scratch) && !ft.is(scratch));
1687 mul_d(scratch, fs, ft); 1724 mul_d(scratch, fs, ft);
1688 add_d(fd, fr, scratch); 1725 add_d(fd, fr, scratch);
1689 } 1726 }
(...skipping 4538 matching lines...) Expand 10 before | Expand all | Expand 10 after
6228 if (mag.shift > 0) sra(result, result, mag.shift); 6265 if (mag.shift > 0) sra(result, result, mag.shift);
6229 srl(at, dividend, 31); 6266 srl(at, dividend, 31);
6230 Addu(result, result, Operand(at)); 6267 Addu(result, result, Operand(at));
6231 } 6268 }
6232 6269
6233 6270
6234 } // namespace internal 6271 } // namespace internal
6235 } // namespace v8 6272 } // namespace v8
6236 6273
6237 #endif // V8_TARGET_ARCH_MIPS64 6274 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698