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 // Truncates a double using a specific rounding mode. | 942 // Truncates a double using a specific rounding mode, and writes the value |
| 943 // to the result register. |
943 // Clears the z flag (ne condition) if an overflow occurs. | 944 // Clears the z flag (ne condition) if an overflow occurs. |
944 // If exact_conversion is true, the z flag is also cleared if the conversion | 945 // If kCheckForInexactConversion is passed, the z flag is also cleared if the |
945 // was inexact, i.e. if the double value could not be converted exactly | 946 // conversion was inexact, i.e. if the double value could not be converted |
946 // to a 32bit integer. | 947 // exactly to a 32-bit integer. |
947 void EmitVFPTruncate(VFPRoundingMode rounding_mode, | 948 void EmitVFPTruncate(VFPRoundingMode rounding_mode, |
948 SwVfpRegister result, | 949 Register result, |
949 DwVfpRegister double_input, | 950 DwVfpRegister double_input, |
950 Register scratch1, | 951 Register scratch, |
951 Register scratch2, | 952 DwVfpRegister double_scratch, |
952 CheckForInexactConversion check | 953 CheckForInexactConversion check |
953 = kDontCheckForInexactConversion); | 954 = kDontCheckForInexactConversion); |
954 | 955 |
955 // Helper for EmitECMATruncate. | 956 // Helper for EmitECMATruncate. |
956 // This will truncate a floating-point value outside of the singed 32bit | 957 // This will truncate a floating-point value outside of the signed 32bit |
957 // integer range to a 32bit signed integer. | 958 // integer range to a 32bit signed integer. |
958 // Expects the double value loaded in input_high and input_low. | 959 // Expects the double value loaded in input_high and input_low. |
959 // Exits with the answer in 'result'. | 960 // Exits with the answer in 'result'. |
960 // Note that this code does not work for values in the 32bit range! | 961 // Note that this code does not work for values in the 32bit range! |
961 void EmitOutOfInt32RangeTruncate(Register result, | 962 void EmitOutOfInt32RangeTruncate(Register result, |
962 Register input_high, | 963 Register input_high, |
963 Register input_low, | 964 Register input_low, |
964 Register scratch); | 965 Register scratch); |
965 | 966 |
966 // Performs a truncating conversion of a floating point number as used by | 967 // Performs a truncating conversion of a floating point number as used by |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1402 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1402 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1403 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1403 #else | 1404 #else |
1404 #define ACCESS_MASM(masm) masm-> | 1405 #define ACCESS_MASM(masm) masm-> |
1405 #endif | 1406 #endif |
1406 | 1407 |
1407 | 1408 |
1408 } } // namespace v8::internal | 1409 } } // namespace v8::internal |
1409 | 1410 |
1410 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1411 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |