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

Unified Diff: src/x87/code-stubs-x87.cc

Issue 2119773003: X87: [turbofan] Introduce Float64Pow and NumberPow operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/compiler/x87/code-generator-x87.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/code-stubs-x87.cc
diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc
index 7b069ac6292c98ee220bf1465f49a676811c98c2..c5b7896002f6809147445c52564cf9271125b7ff 100644
--- a/src/x87/code-stubs-x87.cc
+++ b/src/x87/code-stubs-x87.cc
@@ -270,26 +270,26 @@ void FloatingPointHelper::CheckFloatOperands(MacroAssembler* masm,
void MathPowStub::Generate(MacroAssembler* masm) {
- const Register base = edx;
const Register scratch = ecx;
- Label call_runtime;
-
- // We will call runtime helper function directly.
- if (exponent_type() == ON_STACK) {
- // The arguments are still on the stack.
- __ bind(&call_runtime);
- __ TailCallRuntime(Runtime::kMathPowRT);
-
- // The stub is called from non-optimized code, which expects the result
- // as heap number in exponent.
- __ AllocateHeapNumber(eax, scratch, base, &call_runtime);
- __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
- __ ret(2 * kPointerSize);
- } else {
- // Currently it's only called from full-compiler and exponent type is
- // ON_STACK.
- UNIMPLEMENTED();
+
+ // Load the double_exponent into x87 FPU
+ __ fld_d(Operand(esp, 0 * kDoubleSize + 4));
+ // Load the double_base into x87 FPU
+ __ fld_d(Operand(esp, 1 * kDoubleSize + 4));
+
+ // Call ieee754 runtime directly.
+ {
+ AllowExternalCallThatCantCauseGC scope(masm);
+ __ PrepareCallCFunction(4, scratch);
+ // Put the double_base parameter in call stack
+ __ fstp_d(Operand(esp, 0 * kDoubleSize));
+ // Put the double_exponent parameter in call stack
+ __ fstp_d(Operand(esp, 1 * kDoubleSize));
+ __ CallCFunction(ExternalReference::power_double_double_function(isolate()),
+ 4);
}
+ // Return value is in st(0) on ia32.
+ __ ret(0);
}
« no previous file with comments | « src/compiler/x87/code-generator-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698