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

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

Issue 2285703002: MIPS: Use neg instruction in r6 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months 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/crankshaft/mips64/lithium-codegen-mips64.cc ('k') | src/mips64/macro-assembler-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/macro-assembler-mips.cc
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc
index dba1fae9759f0e323e72a23a443192cca9d9f6f9..95a0064f62715cbc55c0d3e01473297bfbec56ba 100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -1915,8 +1915,6 @@ void MacroAssembler::Ins(Register rt,
}
void MacroAssembler::Neg_s(FPURegister fd, FPURegister fs) {
- Register scratch1 = t8;
- Register scratch2 = t9;
if (IsMipsArchVariant(kMips32r2)) {
Label is_nan, done;
Register scratch1 = t8;
@@ -1926,7 +1924,6 @@ void MacroAssembler::Neg_s(FPURegister fd, FPURegister fs) {
// For NaN input, neg_s will return the same NaN value,
// while the sign has to be changed separately.
neg_s(fd, fs); // In delay slot.
-
bind(&is_nan);
mfc1(scratch1, fs);
And(scratch2, scratch1, Operand(~kBinary32SignMask));
@@ -1936,26 +1933,21 @@ void MacroAssembler::Neg_s(FPURegister fd, FPURegister fs) {
mtc1(scratch2, fd);
bind(&done);
} else {
- mfc1(scratch1, fs);
- And(scratch2, scratch1, Operand(~kBinary32SignMask));
- And(scratch1, scratch1, Operand(kBinary32SignMask));
- Xor(scratch1, scratch1, Operand(kBinary32SignMask));
- Or(scratch2, scratch2, scratch1);
- mtc1(scratch2, fd);
+ // r6 neg_s changes the sign for NaN-like operands as well.
+ neg_s(fd, fs);
}
}
void MacroAssembler::Neg_d(FPURegister fd, FPURegister fs) {
- Register scratch1 = t8;
- Register scratch2 = t9;
if (IsMipsArchVariant(kMips32r2)) {
Label is_nan, done;
+ Register scratch1 = t8;
+ Register scratch2 = t9;
BranchF64(nullptr, &is_nan, eq, fs, fs);
Branch(USE_DELAY_SLOT, &done);
// For NaN input, neg_d will return the same NaN value,
// while the sign has to be changed separately.
neg_d(fd, fs); // In delay slot.
-
bind(&is_nan);
Mfhc1(scratch1, fs);
And(scratch2, scratch1, Operand(~HeapNumber::kSignMask));
@@ -1965,13 +1957,8 @@ void MacroAssembler::Neg_d(FPURegister fd, FPURegister fs) {
Mthc1(scratch2, fd);
bind(&done);
} else {
- Move_d(fd, fs);
- Mfhc1(scratch1, fs);
- And(scratch2, scratch1, Operand(~HeapNumber::kSignMask));
- And(scratch1, scratch1, Operand(HeapNumber::kSignMask));
- Xor(scratch1, scratch1, Operand(HeapNumber::kSignMask));
- Or(scratch2, scratch2, scratch1);
- Mthc1(scratch2, fd);
+ // r6 neg_d changes the sign for NaN-like operands as well.
+ neg_d(fd, fs);
}
}
« no previous file with comments | « src/crankshaft/mips64/lithium-codegen-mips64.cc ('k') | src/mips64/macro-assembler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698