OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 // dest. If the HeapNumber does not fit into a 32bits signed integer branch | 932 // dest. If the HeapNumber does not fit into a 32bits signed integer branch |
933 // to not_int32 label. If VFP3 is available double_scratch is used but not | 933 // to not_int32 label. If VFP3 is available double_scratch is used but not |
934 // scratch2. | 934 // scratch2. |
935 void ConvertToInt32(Register source, | 935 void ConvertToInt32(Register source, |
936 Register dest, | 936 Register dest, |
937 Register scratch, | 937 Register scratch, |
938 Register scratch2, | 938 Register scratch2, |
939 DwVfpRegister double_scratch, | 939 DwVfpRegister double_scratch, |
940 Label *not_int32); | 940 Label *not_int32); |
941 | 941 |
942 // Try to convert a double to a signed 32-bit integer. If the double value | 942 // Check if a double can be exactly represented as a signed 32-bit integer. |
943 // can be exactly represented as an integer, the code jumps to 'done' and | 943 // Z flag set to one if true. |
944 // 'result' contains the integer value. Otherwise, the code falls through. | 944 void TestDoubleIsInt32(DwVfpRegister double_input, |
945 void TryFastDoubleToInt32(Register result, | 945 DwVfpRegister double_scratch); |
946 DwVfpRegister double_input, | |
947 DwVfpRegister double_scratch, | |
948 Label* done); | |
949 | 946 |
950 // Truncates a double using a specific rounding mode, and writes the value | 947 // Try to convert a double to a signed 32-bit integer. |
951 // to the result register. | 948 // Z flag set to one and result assigned if the conversion is exact. |
952 // Clears the z flag (ne condition) if an overflow occurs. | 949 void TryDoubleToInt32Exact(Register result, |
953 // If kCheckForInexactConversion is passed, the z flag is also cleared if the | 950 DwVfpRegister double_input, |
954 // conversion was inexact, i.e. if the double value could not be converted | 951 DwVfpRegister double_scratch); |
955 // exactly to a 32-bit integer. | 952 |
956 void EmitVFPTruncate(VFPRoundingMode rounding_mode, | 953 // Floor a double and writes the value to the result register. |
957 Register result, | 954 // Go to exact if the conversion is exact (to be able to test -0), |
958 DwVfpRegister double_input, | 955 // fall through calling code if an overflow occurred, else go to done. |
959 Register scratch, | 956 void TryInt32Floor(Register result, |
960 DwVfpRegister double_scratch, | 957 DwVfpRegister double_input, |
961 CheckForInexactConversion check | 958 Register input_high, |
962 = kDontCheckForInexactConversion); | 959 DwVfpRegister double_scratch, |
| 960 Label* done, |
| 961 Label* exact); |
963 | 962 |
964 // Helper for EmitECMATruncate. | 963 // Helper for EmitECMATruncate. |
965 // This will truncate a floating-point value outside of the signed 32bit | 964 // This will truncate a floating-point value outside of the signed 32bit |
966 // integer range to a 32bit signed integer. | 965 // integer range to a 32bit signed integer. |
967 // Expects the double value loaded in input_high and input_low. | 966 // Expects the double value loaded in input_high and input_low. |
968 // Exits with the answer in 'result'. | 967 // Exits with the answer in 'result'. |
969 // Note that this code does not work for values in the 32bit range! | 968 // Note that this code does not work for values in the 32bit range! |
970 void EmitOutOfInt32RangeTruncate(Register result, | 969 void EmitOutOfInt32RangeTruncate(Register result, |
971 Register input_high, | 970 Register input_high, |
972 Register input_low, | 971 Register input_low, |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1424 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1423 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1425 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1424 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1426 #else | 1425 #else |
1427 #define ACCESS_MASM(masm) masm-> | 1426 #define ACCESS_MASM(masm) masm-> |
1428 #endif | 1427 #endif |
1429 | 1428 |
1430 | 1429 |
1431 } } // namespace v8::internal | 1430 } } // namespace v8::internal |
1432 | 1431 |
1433 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1432 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |