| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 | 849 |
| 850 __ Branch(&done, ge, exponent, Operand(zero_reg)); | 850 __ Branch(&done, ge, exponent, Operand(zero_reg)); |
| 851 __ Move(double_scratch, 1.0); | 851 __ Move(double_scratch, 1.0); |
| 852 __ div_d(double_result, double_scratch, double_result); | 852 __ div_d(double_result, double_scratch, double_result); |
| 853 // Test whether result is zero. Bail out to check for subnormal result. | 853 // Test whether result is zero. Bail out to check for subnormal result. |
| 854 // Due to subnormals, x^-y == (1/x)^y does not hold in all cases. | 854 // Due to subnormals, x^-y == (1/x)^y does not hold in all cases. |
| 855 __ BranchF(&done, NULL, ne, double_result, kDoubleRegZero); | 855 __ BranchF(&done, NULL, ne, double_result, kDoubleRegZero); |
| 856 | 856 |
| 857 // double_exponent may not contain the exponent value if the input was a | 857 // double_exponent may not contain the exponent value if the input was a |
| 858 // smi. We set it with exponent value before bailing out. | 858 // smi. We set it with exponent value before bailing out. |
| 859 __ bind(&bail_out); |
| 859 __ mtc1(exponent, single_scratch); | 860 __ mtc1(exponent, single_scratch); |
| 860 __ cvt_d_w(double_exponent, single_scratch); | 861 __ cvt_d_w(double_exponent, single_scratch); |
| 861 | 862 |
| 862 // Returning or bailing out. | 863 // Returning or bailing out. |
| 863 __ bind(&bail_out); | |
| 864 __ push(ra); | 864 __ push(ra); |
| 865 { | 865 { |
| 866 AllowExternalCallThatCantCauseGC scope(masm); | 866 AllowExternalCallThatCantCauseGC scope(masm); |
| 867 __ PrepareCallCFunction(0, 2, scratch); | 867 __ PrepareCallCFunction(0, 2, scratch); |
| 868 __ MovToFloatParameters(double_base, double_exponent); | 868 __ MovToFloatParameters(double_base, double_exponent); |
| 869 __ CallCFunction(ExternalReference::power_double_double_function(isolate()), | 869 __ CallCFunction(ExternalReference::power_double_double_function(isolate()), |
| 870 0, 2); | 870 0, 2); |
| 871 } | 871 } |
| 872 __ pop(ra); | 872 __ pop(ra); |
| 873 __ MovFromFloatResult(double_result); | 873 __ MovFromFloatResult(double_result); |
| (...skipping 4569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5443 kStackUnwindSpace, kInvalidStackOffset, | 5443 kStackUnwindSpace, kInvalidStackOffset, |
| 5444 return_value_operand, NULL); | 5444 return_value_operand, NULL); |
| 5445 } | 5445 } |
| 5446 | 5446 |
| 5447 #undef __ | 5447 #undef __ |
| 5448 | 5448 |
| 5449 } // namespace internal | 5449 } // namespace internal |
| 5450 } // namespace v8 | 5450 } // namespace v8 |
| 5451 | 5451 |
| 5452 #endif // V8_TARGET_ARCH_MIPS64 | 5452 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |