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