lkml.org 
[lkml]   [2007]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] div64_64 support
    On 03 Mar 2007 03:31:52 +0100
    Andi Kleen <andi@firstfloor.org> wrote:

    > Stephen Hemminger <shemminger@linux-foundation.org> writes:
    >
    > > Here is another way to handle the 64 bit divide case.
    > > It allows full 64 bit divide by adding the support routine
    > > GCC needs.
    >
    > Not supplying that was intentional by Linus so that people
    > think twice (or more often) before they using such expensive
    > operations. A plain / looks too innocent.
    >
    > Is it really needed by CUBIC anyways? It uses it for getting
    > the cubic root, but the algorithm recommended by Hacker's Delight
    > (great book) doesn't use any divisions at all. Probably better
    > to use a better algorithm without divisions.
    >

    I tried the code from Hacker's Delight.
    It is cool, but performance is CPU (and data) dependent:

    Average # of usecs per operation:

    Hacker Newton
    Pentium 3 68.6 < 90.4
    T2050 98.6 > 92.0
    U1400 450 > 415
    Xeon 70 < 90
    Xeon (newer) 71 < 78

    EM64T 21.8 < 24.6
    AMD64 23.4 < 32.0

    It might be worth the change for code size reduction though.


    --
    Stephen Hemminger <shemminger@linux-foundation.org>
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-03-06 01:01    [W:3.058 / U:0.148 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site