lkml.org 
[lkml]   [2012]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/4] lib: vsprintf: Optimize division by 10 for small integers.
    Michal Nazarewicz <mpn@google.com> wrote:
    > On Fri, Aug 03 2012, George Spelvin <linux@horizon.com> wrote:
    >> Shrink the reciprocal approximations used in put_dec_full4
    >> based on the comments in put_dec_full9.
    >
    > Have you verified that the comment is correct?

    I rechecked all the validity limits myself.

    >> r = (q * 0xcd) >> 11;

    > If you are changing everything, this could also be changed to:
    >
    > r = (q * 0x67) >> 10;
    >
    > no?

    Also in those comments is a statement I did *not* recheck, as it didn't
    affect correctness, saying that 0xcd produces shorter code than 0x67 on
    x86 (if the code is generated using shifts and adds).

    That's why I left it that way.


    \
     
     \ /
      Last update: 2012-09-24 17:01    [W:2.988 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site