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