| 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_MIPS64 | 9 #if V8_TARGET_ARCH_MIPS64 |
| 10 | 10 |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 __ Move(double_scratch, 0.5); | 846 __ Move(double_scratch, 0.5); |
| 847 __ BranchF(USE_DELAY_SLOT, | 847 __ BranchF(USE_DELAY_SLOT, |
| 848 ¬_plus_half, | 848 ¬_plus_half, |
| 849 NULL, | 849 NULL, |
| 850 ne, | 850 ne, |
| 851 double_exponent, | 851 double_exponent, |
| 852 double_scratch); | 852 double_scratch); |
| 853 // double_scratch can be overwritten in the delay slot. | 853 // double_scratch can be overwritten in the delay slot. |
| 854 // Calculates square root of base. Check for the special case of | 854 // Calculates square root of base. Check for the special case of |
| 855 // Math.pow(-Infinity, 0.5) == Infinity (ECMA spec, 15.8.2.13). | 855 // Math.pow(-Infinity, 0.5) == Infinity (ECMA spec, 15.8.2.13). |
| 856 __ Move(double_scratch, std::numeric_limits<double>::infinity()); | 856 __ Move(double_scratch, -std::numeric_limits<double>::infinity()); |
| 857 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, double_base, double_scratch); | 857 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, double_base, double_scratch); |
| 858 __ neg_d(double_result, double_scratch); | 858 __ neg_d(double_result, double_scratch); |
| 859 | 859 |
| 860 // Add +0 to convert -0 to +0. | 860 // Add +0 to convert -0 to +0. |
| 861 __ add_d(double_scratch, double_base, kDoubleRegZero); | 861 __ add_d(double_scratch, double_base, kDoubleRegZero); |
| 862 __ sqrt_d(double_result, double_scratch); | 862 __ sqrt_d(double_result, double_scratch); |
| 863 __ jmp(&done); | 863 __ jmp(&done); |
| 864 | 864 |
| 865 __ bind(¬_plus_half); | 865 __ bind(¬_plus_half); |
| 866 __ Move(double_scratch, -0.5); | 866 __ Move(double_scratch, -0.5); |
| 867 __ BranchF(USE_DELAY_SLOT, | 867 __ BranchF(USE_DELAY_SLOT, |
| 868 &call_runtime, | 868 &call_runtime, |
| 869 NULL, | 869 NULL, |
| 870 ne, | 870 ne, |
| 871 double_exponent, | 871 double_exponent, |
| 872 double_scratch); | 872 double_scratch); |
| 873 // double_scratch can be overwritten in the delay slot. | 873 // double_scratch can be overwritten in the delay slot. |
| 874 // Calculates square root of base. Check for the special case of | 874 // Calculates square root of base. Check for the special case of |
| 875 // Math.pow(-Infinity, -0.5) == 0 (ECMA spec, 15.8.2.13). | 875 // Math.pow(-Infinity, -0.5) == 0 (ECMA spec, 15.8.2.13). |
| 876 __ Move(double_scratch, std::numeric_limits<double>::infinity()); | 876 __ Move(double_scratch, -std::numeric_limits<double>::infinity()); |
| 877 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, double_base, double_scratch); | 877 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, double_base, double_scratch); |
| 878 __ Move(double_result, kDoubleRegZero); | 878 __ Move(double_result, kDoubleRegZero); |
| 879 | 879 |
| 880 // Add +0 to convert -0 to +0. | 880 // Add +0 to convert -0 to +0. |
| 881 __ add_d(double_scratch, double_base, kDoubleRegZero); | 881 __ add_d(double_scratch, double_base, kDoubleRegZero); |
| 882 __ Move(double_result, 1.); | 882 __ Move(double_result, 1.); |
| 883 __ sqrt_d(double_scratch, double_scratch); | 883 __ sqrt_d(double_scratch, double_scratch); |
| 884 __ div_d(double_result, double_result, double_scratch); | 884 __ div_d(double_result, double_result, double_scratch); |
| 885 __ jmp(&done); | 885 __ jmp(&done); |
| 886 } | 886 } |
| (...skipping 4121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5008 MemOperand(fp, 6 * kPointerSize), | 5008 MemOperand(fp, 6 * kPointerSize), |
| 5009 NULL); | 5009 NULL); |
| 5010 } | 5010 } |
| 5011 | 5011 |
| 5012 | 5012 |
| 5013 #undef __ | 5013 #undef __ |
| 5014 | 5014 |
| 5015 } } // namespace v8::internal | 5015 } } // namespace v8::internal |
| 5016 | 5016 |
| 5017 #endif // V8_TARGET_ARCH_MIPS64 | 5017 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |