Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(681)

Side by Side Diff: src/arm/macro-assembler-arm.h

Issue 6625084: ARM: Improved double to integer truncation.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 // dest. If the HeapNumber does not fit into a 32bits signed integer branch 642 // dest. If the HeapNumber does not fit into a 32bits signed integer branch
643 // to not_int32 label. If VFP3 is available double_scratch is used but not 643 // to not_int32 label. If VFP3 is available double_scratch is used but not
644 // scratch2. 644 // scratch2.
645 void ConvertToInt32(Register source, 645 void ConvertToInt32(Register source,
646 Register dest, 646 Register dest,
647 Register scratch, 647 Register scratch,
648 Register scratch2, 648 Register scratch2,
649 DwVfpRegister double_scratch, 649 DwVfpRegister double_scratch,
650 Label *not_int32); 650 Label *not_int32);
651 651
652 // Truncates a double using a specific rounding mode. 652 // Truncates a double using a specific rounding mode.
653 // Clears the z flag (ne condition) if an overflow occurs. 653 // Clears the z flag (ne condition) if an overflow occurs.
654 // If exact_conversion is true, the z flag is also cleared if the conversion 654 // If exact_conversion is true, the z flag is also cleared if the conversion
655 // was inexact, ie. if the double value could not be converted exactly 655 // was inexact, ie. if the double value could not be converted exactly
656 // to a 32bit integer. 656 // to a 32bit integer.
657 void EmitVFPTruncate(VFPRoundingMode rounding_mode, 657 void EmitVFPTruncate(VFPRoundingMode rounding_mode,
658 SwVfpRegister result, 658 SwVfpRegister result,
659 DwVfpRegister double_input, 659 DwVfpRegister double_input,
660 Register scratch1, 660 Register scratch1,
661 Register scratch2, 661 Register scratch2,
662 CheckForInexactConversion check 662 CheckForInexactConversion check
663 = kDontCheckForInexactConversion); 663 = kDontCheckForInexactConversion);
664 664
665 // Helper for EmitECMATruncate.
666 // This will truncate a floating-point value outside of the singed 32bit
667 // integer range to a 32bit signed integer.
668 // Expects the double value loaded in input_high and input_low.
669 // Exits with the answer in 'result'.
670 // Note that this code does not work for values in the 32bit range!
671 void EmitOutOfInt32RangeTruncate(Register result,
672 Register input_high,
673 Register input_low,
674 Register scratch);
675
676 // Performs a truncating conversion of a floating point number as used by
677 // the JS bitwise operations. See ECMA-262 9.5: ToInt32.
678 // Exits with 'result' holding the answer and all other registers clobbered.
679 void EmitECMATruncate(Register result,
680 DwVfpRegister double_input,
681 SwVfpRegister single_scratch,
682 Register scratch,
683 Register scratch2,
684 Register scratch3);
685
665 // Count leading zeros in a 32 bit word. On ARM5 and later it uses the clz 686 // Count leading zeros in a 32 bit word. On ARM5 and later it uses the clz
666 // instruction. On pre-ARM5 hardware this routine gives the wrong answer 687 // instruction. On pre-ARM5 hardware this routine gives the wrong answer
667 // for 0 (31 instead of 32). Source and scratch can be the same in which case 688 // for 0 (31 instead of 32). Source and scratch can be the same in which case
668 // the source is clobbered. Source and zeros can also be the same in which 689 // the source is clobbered. Source and zeros can also be the same in which
669 // case scratch should be a different register. 690 // case scratch should be a different register.
670 void CountLeadingZeros(Register zeros, 691 void CountLeadingZeros(Register zeros,
671 Register source, 692 Register source,
672 Register scratch); 693 Register scratch);
673 694
674 // --------------------------------------------------------------------------- 695 // ---------------------------------------------------------------------------
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) 1040 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__)
1020 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> 1041 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm->
1021 #else 1042 #else
1022 #define ACCESS_MASM(masm) masm-> 1043 #define ACCESS_MASM(masm) masm->
1023 #endif 1044 #endif
1024 1045
1025 1046
1026 } } // namespace v8::internal 1047 } } // namespace v8::internal
1027 1048
1028 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ 1049 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698