Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index edc2741849154e441bfdca03dc2cab313f6791b4..9a36b4a655a7c7b14ce077782f705cb759a508c5 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -831,13 +831,22 @@ void FloatingPointHelper::CallCCodeForDoubleOperation( |
// through pop(pc) below. |
__ push(lr); |
__ PrepareCallCFunction(4, scratch); // Two doubles are 4 arguments. |
Søren Thygesen Gjesse
2011/04/27 08:19:01
We should probably pass 0 instead of 4 here for ha
Karl Klose
2011/04/27 12:54:13
Changed to PrepareCallCFunction(0, 2, scratch).
|
+ if (FLAG_hardfloat) { |
Søren Thygesen Gjesse
2011/04/27 08:19:01
As far as I can see CallCCodeForDoubleOperation is
Karl Klose
2011/04/27 12:54:13
It is used from the TRBO stub, also with VFP3.
|
+ __ vmov(d0, r0, r1); |
+ __ vmov(d1, r2, r3); |
+ } |
// Call C routine that may not cause GC or other trouble. |
__ CallCFunction(ExternalReference::double_fp_operation(op, masm->isolate()), |
4); |
// Store answer in the overwritable heap number. Double returned in |
- // registers r0 and r1. |
- __ Strd(r0, r1, FieldMemOperand(heap_number_result, |
- HeapNumber::kValueOffset)); |
+ // registers r0 and r1 or in d0. |
+ if (FLAG_hardfloat) { |
+ __ vstr(d0, |
+ FieldMemOperand(heap_number_result, HeapNumber::kValueOffset)); |
+ } else { |
+ __ Strd(r0, r1, FieldMemOperand(heap_number_result, |
+ HeapNumber::kValueOffset)); |
+ } |
// Place heap_number_result in r0 and return to the pushed return address. |
__ mov(r0, Operand(heap_number_result)); |
__ pop(pc); |
@@ -1180,6 +1189,10 @@ static void EmitTwoNonNanDoubleComparison(MacroAssembler* masm, |
// Call C routine that may not cause GC or other trouble. |
__ push(lr); |
__ PrepareCallCFunction(4, r5); // Two doubles count as 4 arguments. |
+ if (FLAG_hardfloat) { |
+ __ vmov(d0, r0, r1); |
+ __ vmov(d1, r2, r3); |
+ } |
__ CallCFunction(ExternalReference::compare_doubles(masm->isolate()), 4); |
__ pop(pc); // Return. |
} |
@@ -2829,7 +2842,11 @@ void TranscendentalCacheStub::GenerateCallCFunction(MacroAssembler* masm, |
__ push(lr); |
__ PrepareCallCFunction(2, scratch); |
- __ vmov(r0, r1, d2); |
+ if (FLAG_hardfloat) { |
Søren Thygesen Gjesse
2011/04/27 08:19:01
I think we should consider changing the Transcende
|
+ __ vmov(d0, d2); |
+ } else { |
+ __ vmov(r0, r1, d2); |
+ } |
switch (type_) { |
case TranscendentalCache::SIN: |
__ CallCFunction(ExternalReference::math_sin_double_function(isolate), 2); |
@@ -3056,8 +3073,7 @@ void MathPowStub::Generate(MacroAssembler* masm) { |
&call_runtime); |
__ push(lr); |
__ PrepareCallCFunction(3, scratch); |
- __ mov(r2, exponent); |
- __ vmov(r0, r1, double_base); |
+ __ SetCallCDoubleArguments(double_base, exponent); |
__ CallCFunction( |
ExternalReference::power_double_int_function(masm->isolate()), 3); |
__ pop(lr); |
@@ -3086,8 +3102,7 @@ void MathPowStub::Generate(MacroAssembler* masm) { |
&call_runtime); |
__ push(lr); |
__ PrepareCallCFunction(4, scratch); |
- __ vmov(r0, r1, double_base); |
- __ vmov(r2, r3, double_exponent); |
+ __ SetCallCDoubleArguments(double_base, double_exponent); |
__ CallCFunction( |
ExternalReference::power_double_double_function(masm->isolate()), 4); |
__ pop(lr); |