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

Unified Diff: src/mips/lithium-codegen-mips.cc

Issue 8822014: MIPS: Fixing MathPowHalf on ARM. (Closed)
Patch Set: Created 9 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 | src/mips/lithium-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc
index 0af1f50a8e6498de99f5f5d8f0ca735e12a453e5..760ce30c2faeb686821aad25eae347bcc8ea2ba2 100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -2996,13 +2996,24 @@ void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) {
void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) {
DoubleRegister input = ToDoubleRegister(instr->InputAt(0));
DoubleRegister result = ToDoubleRegister(instr->result());
- DoubleRegister double_scratch = double_scratch0();
+ DoubleRegister temp = ToDoubleRegister(instr->TempAt(0));
+
Yang 2011/12/06 16:21:53 From what I can see, you don't need to reserve an
kalmard 2011/12/08 13:19:27 I generally try to stick close to the ARM version
+ ASSERT(!input.is(result));
+
+ // Note that according to ECMA-262 15.8.2.13:
+ // Math.pow(-Infinity, 0.5) == Infinity
+ // Math.sqrt(-Infinity) == NaN
+ Label done;
+ __ Move(temp, -V8_INFINITY);
+ __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, temp, input);
+ // Set up Infinity in the delay slot.
+ // result is overwritten if the branch is not taken.
+ __ neg_d(result, temp);
// Add +0 to convert -0 to +0.
- __ mtc1(zero_reg, double_scratch.low());
- __ mtc1(zero_reg, double_scratch.high());
- __ add_d(result, input, double_scratch);
+ __ add_d(result, input, kDoubleRegZero);
__ sqrt_d(result, result);
+ __ bind(&done);
}
« no previous file with comments | « no previous file | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698