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