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

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

Issue 8769037: Quickfix for DoMathPowHalf. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 | « src/ia32/code-stubs-ia32.cc ('k') | test/mjsunit/regress/regress-397.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index 052115bd417badedb371a90ef22fbebd2fcee854..b49dfaf9429aaa9abfbcddfaebf1a92c00aa7cf6 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -2938,9 +2938,28 @@ void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) {
XMMRegister xmm_scratch = xmm0;
XMMRegister input_reg = ToDoubleRegister(instr->value());
ASSERT(ToDoubleRegister(instr->result()).is(input_reg));
+
+ Label return_infinity, done;
+ // Check base for +/- infinity.
+ __ push(ecx);
Erik Corry 2011/12/02 13:11:02 This is nasty. We have support for allocating tem
+ __ mov(ecx, factory()->infinity_value());
+ __ ucomisd(input_reg, FieldOperand(ecx, HeapNumber::kValueOffset));
+ __ j(equal, &return_infinity, Label::kNear);
+ __ xorps(xmm_scratch, xmm_scratch);
+ __ subsd(xmm_scratch, input_reg);
+ __ ucomisd(xmm_scratch, FieldOperand(ecx, HeapNumber::kValueOffset));
+ __ j(equal, &return_infinity, Label::kNear);
+
+ __ pop(ecx);
__ xorps(xmm_scratch, xmm_scratch);
__ addsd(input_reg, xmm_scratch); // Convert -0 to +0.
__ sqrtsd(input_reg, input_reg);
+ __ jmp(&done, Label::kNear);
+
+ __ bind(&return_infinity);
+ __ movdbl(input_reg, FieldOperand(ecx, HeapNumber::kValueOffset));
+ __ pop(ecx);
+ __ bind(&done);
}
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | test/mjsunit/regress/regress-397.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698