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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/macro-assembler-mips64.cc
diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc
index c8ae983d502fa04f3723dc6dc195a960fdc68bd5..6307e526c83865d30cacfe6fd4248e48ad7337c0 100644
--- a/src/mips64/macro-assembler-mips64.cc
+++ b/src/mips64/macro-assembler-mips64.cc
@@ -1623,6 +1623,12 @@ void MacroAssembler::Trunc_uw_d(FPURegister fd,
mtc1(t8, fd);
}
+void MacroAssembler::Trunc_ul_d(FPURegister fd, FPURegister fs,
+ FPURegister scratch) {
+ Trunc_ul_d(fs, t8, scratch);
+ dmtc1(t8, fd);
+}
+
void MacroAssembler::Trunc_w_d(FPURegister fd, FPURegister fs) {
trunc_w_d(fd, fs);
@@ -1677,6 +1683,37 @@ void MacroAssembler::Trunc_uw_d(FPURegister fd,
}
+void MacroAssembler::Trunc_ul_d(FPURegister fd, Register rs,
+ FPURegister scratch) {
+ DCHECK(!fd.is(scratch));
+ DCHECK(!rs.is(at));
+
+ // Load 2^63 into scratch as its float representation.
+ li(at, 0x43e0000000000000);
+ dmtc1(at, scratch);
+
+ // Test if scratch > fd.
+ // If fd < 2^63 we can convert it normally.
+ Label simple_convert, done;
+ BranchF(&simple_convert, NULL, lt, fd, scratch);
+
+ // First we subtract 2^63 from fd, then trunc it to rs
+ // and add 2^63 to rs.
+ sub_d(scratch, fd, scratch);
+ trunc_l_d(scratch, scratch);
+ dmfc1(rs, scratch);
+ 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
+ Branch(&done);
+
+ // Simple conversion.
+ bind(&simple_convert);
+ trunc_l_d(scratch, fd);
+ dmfc1(rs, scratch);
+
+ bind(&done);
+}
+
+
void MacroAssembler::Madd_d(FPURegister fd, FPURegister fr, FPURegister fs,
FPURegister ft, FPURegister scratch) {
if (0) { // TODO(plind): find reasonable arch-variant symbol names.
« 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