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 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
952 // dest. If the HeapNumber does not fit into a 32bits signed integer branch | 952 // dest. If the HeapNumber does not fit into a 32bits signed integer branch |
953 // to not_int32 label. If VFP3 is available double_scratch is used but not | 953 // to not_int32 label. If VFP3 is available double_scratch is used but not |
954 // scratch2. | 954 // scratch2. |
955 void ConvertToInt32(Register source, | 955 void ConvertToInt32(Register source, |
956 Register dest, | 956 Register dest, |
957 Register scratch, | 957 Register scratch, |
958 Register scratch2, | 958 Register scratch2, |
959 DwVfpRegister double_scratch, | 959 DwVfpRegister double_scratch, |
960 Label *not_int32); | 960 Label *not_int32); |
961 | 961 |
962 // Try to convert a double to a signed 32-bit integer. If the double value | |
963 // can be exactly represented as an integer the code jump to 'done' and | |
964 // 'result' contains the integer value. Otherwise the code fall trough. | |
ulan
2012/12/05 15:43:15
Minor nit: should be ", the code jumps" and ", the
| |
965 void TryFastDoubleToInt32(Register result, | |
966 DwVfpRegister double_input, | |
967 DwVfpRegister double_scratch, | |
968 Label* done); | |
969 | |
962 // Truncates a double using a specific rounding mode, and writes the value | 970 // Truncates a double using a specific rounding mode, and writes the value |
963 // to the result register. | 971 // to the result register. |
964 // Clears the z flag (ne condition) if an overflow occurs. | 972 // Clears the z flag (ne condition) if an overflow occurs. |
965 // If kCheckForInexactConversion is passed, the z flag is also cleared if the | 973 // If kCheckForInexactConversion is passed, the z flag is also cleared if the |
966 // conversion was inexact, i.e. if the double value could not be converted | 974 // conversion was inexact, i.e. if the double value could not be converted |
967 // exactly to a 32-bit integer. | 975 // exactly to a 32-bit integer. |
968 void EmitVFPTruncate(VFPRoundingMode rounding_mode, | 976 void EmitVFPTruncate(VFPRoundingMode rounding_mode, |
969 Register result, | 977 Register result, |
970 DwVfpRegister double_input, | 978 DwVfpRegister double_input, |
971 Register scratch, | 979 Register scratch, |
(...skipping 10 matching lines...) Expand all Loading... | |
982 void EmitOutOfInt32RangeTruncate(Register result, | 990 void EmitOutOfInt32RangeTruncate(Register result, |
983 Register input_high, | 991 Register input_high, |
984 Register input_low, | 992 Register input_low, |
985 Register scratch); | 993 Register scratch); |
986 | 994 |
987 // Performs a truncating conversion of a floating point number as used by | 995 // Performs a truncating conversion of a floating point number as used by |
988 // the JS bitwise operations. See ECMA-262 9.5: ToInt32. | 996 // the JS bitwise operations. See ECMA-262 9.5: ToInt32. |
989 // Exits with 'result' holding the answer and all other registers clobbered. | 997 // Exits with 'result' holding the answer and all other registers clobbered. |
990 void EmitECMATruncate(Register result, | 998 void EmitECMATruncate(Register result, |
991 DwVfpRegister double_input, | 999 DwVfpRegister double_input, |
992 SwVfpRegister single_scratch, | 1000 DwVfpRegister double_scratch, |
993 Register scratch, | 1001 Register scratch, |
994 Register scratch2, | 1002 Register scratch2, |
995 Register scratch3); | 1003 Register scratch3); |
996 | 1004 |
997 // Count leading zeros in a 32 bit word. On ARM5 and later it uses the clz | 1005 // Count leading zeros in a 32 bit word. On ARM5 and later it uses the clz |
998 // instruction. On pre-ARM5 hardware this routine gives the wrong answer | 1006 // instruction. On pre-ARM5 hardware this routine gives the wrong answer |
999 // for 0 (31 instead of 32). Source and scratch can be the same in which case | 1007 // for 0 (31 instead of 32). Source and scratch can be the same in which case |
1000 // the source is clobbered. Source and zeros can also be the same in which | 1008 // the source is clobbered. Source and zeros can also be the same in which |
1001 // case scratch should be a different register. | 1009 // case scratch should be a different register. |
1002 void CountLeadingZeros(Register zeros, | 1010 void CountLeadingZeros(Register zeros, |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1421 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1429 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1422 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1430 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1423 #else | 1431 #else |
1424 #define ACCESS_MASM(masm) masm-> | 1432 #define ACCESS_MASM(masm) masm-> |
1425 #endif | 1433 #endif |
1426 | 1434 |
1427 | 1435 |
1428 } } // namespace v8::internal | 1436 } } // namespace v8::internal |
1429 | 1437 |
1430 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1438 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |