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