This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Speed-up decimal formatting of integers.


On Mon, Feb 05, 2007 at 08:25:27PM +0300, Sergei Organov wrote:
> 
> Current vfnprintf() implementation always uses long long arithmetic when
> formatting integers. While this is acceptable for formatting in
> hexadecimal and octal, for formatting in decimal it results in using
> of generic long long integer division function (GCC built-in) that is
> very time consuming, especially for targets without hardware integer
> division.
> 
> In addition, changing the type of division from "long long" to "long"
> allows GCC to replace the division by 10 by the special fast inline
> algorithm that avoids using of generic division routine entirely.
> 
> The attached patch gets rid of long long division, unless long long
> argument is to be printed.
> 

Thanks
        Committed,
                Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]