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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 __ Move(double_scratch, 0.5); | 844 __ Move(double_scratch, 0.5); |
845 __ BranchF(USE_DELAY_SLOT, | 845 __ BranchF(USE_DELAY_SLOT, |
846 ¬_plus_half, | 846 ¬_plus_half, |
847 NULL, | 847 NULL, |
848 ne, | 848 ne, |
849 double_exponent, | 849 double_exponent, |
850 double_scratch); | 850 double_scratch); |
851 // double_scratch can be overwritten in the delay slot. | 851 // double_scratch can be overwritten in the delay slot. |
852 // Calculates square root of base. Check for the special case of | 852 // Calculates square root of base. Check for the special case of |
853 // Math.pow(-Infinity, 0.5) == Infinity (ECMA spec, 15.8.2.13). | 853 // Math.pow(-Infinity, 0.5) == Infinity (ECMA spec, 15.8.2.13). |
854 __ Move(double_scratch, -V8_INFINITY); | 854 __ Move(double_scratch, static_cast<double>(-V8_INFINITY)); |
855 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, double_base, double_scratch); | 855 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, double_base, double_scratch); |
856 __ neg_d(double_result, double_scratch); | 856 __ neg_d(double_result, double_scratch); |
857 | 857 |
858 // Add +0 to convert -0 to +0. | 858 // Add +0 to convert -0 to +0. |
859 __ add_d(double_scratch, double_base, kDoubleRegZero); | 859 __ add_d(double_scratch, double_base, kDoubleRegZero); |
860 __ sqrt_d(double_result, double_scratch); | 860 __ sqrt_d(double_result, double_scratch); |
861 __ jmp(&done); | 861 __ jmp(&done); |
862 | 862 |
863 __ bind(¬_plus_half); | 863 __ bind(¬_plus_half); |
864 __ Move(double_scratch, -0.5); | 864 __ Move(double_scratch, -0.5); |
865 __ BranchF(USE_DELAY_SLOT, | 865 __ BranchF(USE_DELAY_SLOT, |
866 &call_runtime, | 866 &call_runtime, |
867 NULL, | 867 NULL, |
868 ne, | 868 ne, |
869 double_exponent, | 869 double_exponent, |
870 double_scratch); | 870 double_scratch); |
871 // double_scratch can be overwritten in the delay slot. | 871 // double_scratch can be overwritten in the delay slot. |
872 // Calculates square root of base. Check for the special case of | 872 // Calculates square root of base. Check for the special case of |
873 // Math.pow(-Infinity, -0.5) == 0 (ECMA spec, 15.8.2.13). | 873 // Math.pow(-Infinity, -0.5) == 0 (ECMA spec, 15.8.2.13). |
874 __ Move(double_scratch, -V8_INFINITY); | 874 __ Move(double_scratch, static_cast<double>(-V8_INFINITY)); |
875 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, double_base, double_scratch); | 875 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, double_base, double_scratch); |
876 __ Move(double_result, kDoubleRegZero); | 876 __ Move(double_result, kDoubleRegZero); |
877 | 877 |
878 // Add +0 to convert -0 to +0. | 878 // Add +0 to convert -0 to +0. |
879 __ add_d(double_scratch, double_base, kDoubleRegZero); | 879 __ add_d(double_scratch, double_base, kDoubleRegZero); |
880 __ Move(double_result, 1); | 880 __ Move(double_result, 1.); |
881 __ sqrt_d(double_scratch, double_scratch); | 881 __ sqrt_d(double_scratch, double_scratch); |
882 __ div_d(double_result, double_result, double_scratch); | 882 __ div_d(double_result, double_result, double_scratch); |
883 __ jmp(&done); | 883 __ jmp(&done); |
884 } | 884 } |
885 | 885 |
886 __ push(ra); | 886 __ push(ra); |
887 { | 887 { |
888 AllowExternalCallThatCantCauseGC scope(masm); | 888 AllowExternalCallThatCantCauseGC scope(masm); |
889 __ PrepareCallCFunction(0, 2, scratch2); | 889 __ PrepareCallCFunction(0, 2, scratch2); |
890 __ MovToFloatParameters(double_base, double_exponent); | 890 __ MovToFloatParameters(double_base, double_exponent); |
(...skipping 4080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4971 MemOperand(fp, 6 * kPointerSize), | 4971 MemOperand(fp, 6 * kPointerSize), |
4972 NULL); | 4972 NULL); |
4973 } | 4973 } |
4974 | 4974 |
4975 | 4975 |
4976 #undef __ | 4976 #undef __ |
4977 | 4977 |
4978 } } // namespace v8::internal | 4978 } } // namespace v8::internal |
4979 | 4979 |
4980 #endif // V8_TARGET_ARCH_MIPS64 | 4980 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |