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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 | 852 |
853 __ Branch(&done, ge, exponent, Operand(zero_reg)); | 853 __ Branch(&done, ge, exponent, Operand(zero_reg)); |
854 __ Move(double_scratch, 1.0); | 854 __ Move(double_scratch, 1.0); |
855 __ div_d(double_result, double_scratch, double_result); | 855 __ div_d(double_result, double_scratch, double_result); |
856 // Test whether result is zero. Bail out to check for subnormal result. | 856 // Test whether result is zero. Bail out to check for subnormal result. |
857 // Due to subnormals, x^-y == (1/x)^y does not hold in all cases. | 857 // Due to subnormals, x^-y == (1/x)^y does not hold in all cases. |
858 __ BranchF(&done, NULL, ne, double_result, kDoubleRegZero); | 858 __ BranchF(&done, NULL, ne, double_result, kDoubleRegZero); |
859 | 859 |
860 // double_exponent may not contain the exponent value if the input was a | 860 // double_exponent may not contain the exponent value if the input was a |
861 // smi. We set it with exponent value before bailing out. | 861 // smi. We set it with exponent value before bailing out. |
| 862 __ bind(&bail_out); |
862 __ mtc1(exponent, single_scratch); | 863 __ mtc1(exponent, single_scratch); |
863 __ cvt_d_w(double_exponent, single_scratch); | 864 __ cvt_d_w(double_exponent, single_scratch); |
864 | 865 |
865 // Returning or bailing out. | 866 // Returning or bailing out. |
866 __ bind(&bail_out); | |
867 __ push(ra); | 867 __ push(ra); |
868 { | 868 { |
869 AllowExternalCallThatCantCauseGC scope(masm); | 869 AllowExternalCallThatCantCauseGC scope(masm); |
870 __ PrepareCallCFunction(0, 2, scratch); | 870 __ PrepareCallCFunction(0, 2, scratch); |
871 __ MovToFloatParameters(double_base, double_exponent); | 871 __ MovToFloatParameters(double_base, double_exponent); |
872 __ CallCFunction(ExternalReference::power_double_double_function(isolate()), | 872 __ CallCFunction(ExternalReference::power_double_double_function(isolate()), |
873 0, 2); | 873 0, 2); |
874 } | 874 } |
875 __ pop(ra); | 875 __ pop(ra); |
876 __ MovFromFloatResult(double_result); | 876 __ MovFromFloatResult(double_result); |
(...skipping 4533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5410 kStackUnwindSpace, kInvalidStackOffset, | 5410 kStackUnwindSpace, kInvalidStackOffset, |
5411 return_value_operand, NULL); | 5411 return_value_operand, NULL); |
5412 } | 5412 } |
5413 | 5413 |
5414 #undef __ | 5414 #undef __ |
5415 | 5415 |
5416 } // namespace internal | 5416 } // namespace internal |
5417 } // namespace v8 | 5417 } // namespace v8 |
5418 | 5418 |
5419 #endif // V8_TARGET_ARCH_MIPS | 5419 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |