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

Unified Diff: src/mips64/macro-assembler-mips64.cc

Issue 1510493012: MIPS64: Fix BranchF() usage. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comments. Created 5 years 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 | « no previous file | 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 8dcd9d6c065739600ebaeafbe9f8bb45e042ea50..40c35c0092af5cb3f033e2474eadfde93d8846a8 100644
--- a/src/mips64/macro-assembler-mips64.cc
+++ b/src/mips64/macro-assembler-mips64.cc
@@ -1706,6 +1706,7 @@ void MacroAssembler::Trunc_ul_d(FPURegister fd, Register rs,
if (result.is_valid()) {
mov(result, zero_reg);
Move(kDoubleRegZero, 0.0);
+ // If fd < 0 or unordered, then the conversion fails.
BranchF(&fail, &fail, lt, fd, kDoubleRegZero);
}
@@ -1715,8 +1716,7 @@ void MacroAssembler::Trunc_ul_d(FPURegister fd, Register rs,
// Test if scratch > fd.
// If fd < 2^63 we can convert it normally.
- // If fd is unordered the conversion fails.
- BranchF(&simple_convert, &fail, lt, fd, scratch);
+ BranchF(&simple_convert, nullptr, lt, fd, scratch);
// First we subtract 2^63 from fd, then trunc it to rs
// and add 2^63 to rs.
@@ -1733,9 +1733,12 @@ void MacroAssembler::Trunc_ul_d(FPURegister fd, Register rs,
bind(&done);
if (result.is_valid()) {
- // Conversion is failed if the result is negative or unordered.
- BranchF(&fail, &fail, lt, scratch, kDoubleRegZero);
- li(result, Operand(1));
+ // Conversion is failed if the result is negative.
+ addiu(at, zero_reg, -1);
+ dsrl(at, at, 1); // Load 2^62.
+ dmfc1(result, scratch);
+ xor_(result, result, at);
+ Slt(result, zero_reg, result);
}
bind(&fail);
@@ -1761,7 +1764,6 @@ void MacroAssembler::Trunc_ul_s(FPURegister fd, Register rs,
// Test if scratch > fd.
// If fd < 2^63 we can convert it normally.
- // // If fd is unordered the conversion fails.
BranchF32(&simple_convert, nullptr, lt, fd, scratch);
// First we subtract 2^63 from fd, then trunc it to rs
@@ -1780,8 +1782,11 @@ void MacroAssembler::Trunc_ul_s(FPURegister fd, Register rs,
bind(&done);
if (result.is_valid()) {
// Conversion is failed if the result is negative or unordered.
- BranchF(&fail, &fail, lt, scratch, kDoubleRegZero);
- li(result, Operand(1));
+ addiu(at, zero_reg, -1);
+ dsrl(at, at, 1); // Load 2^62.
+ dmfc1(result, scratch);
+ xor_(result, result, at);
+ Slt(result, zero_reg, result);
}
bind(&fail);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698