[lkml]   [2004]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: How to use floating point in a module?
    H. Peter Anvin replied to me:

    >> (The CPU is an i686. I'll have to look up its opcodes and see if its
    >> hardware will come close enough for everything the driver needs. If it
    >> doesn't, I'll buy one of the books that some others kindly recommended
    >> and do polynomial approximations.)
    > On x86 (more specifically, on x87) if you can do it at all then you
    > can do them all.

    I'm not quite sure what that means. It was pretty easy to code a log2()
    function using the built-in opcode, but it took me nearly a day to code
    an exp2() function. The built-in f2xm1 opcode helps a lot but there's
    no help for the other half exp2()'s lot.

    I'm sure you and other x86 assembly experts can improve on this if
    you ever have any need for it. The only consolation I get is that
    for some reason gcc does library calls for log10 and pow. It would be
    really trivial to inline log10, though maybe pow is too big to benefit
    from inlining.
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:03    [W:0.017 / U:16.200 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site