1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

64bit/64bit fixed point division?

Discussion in 'Intel' started by marie, Aug 22, 2006.

  1. marie

    marie Guest

    Hi!
    I wrote a C++ class for a 64bit fixed point numeric format,
    32bit integral and 32bit fractional. I wrote addition,
    subtraction and multiplication operator routines (the latter
    in inline assembly). Now I need an assembly routine to inline
    to compute division, but I'm having many problems finding the
    fastest way to do it. How was easy with multiplication to get
    advantage of the hardware multiplier!
    How can it be that the "hardware" multiplier is useless in
    this case? Ok, it has to do with laws of nature (a.k.a. math)
    and such but, how would be the fastest way to perform a div
    between two 64bit fixed point operands (with the point exactly
    in the middle) and produce a 128bit result and/or a 64bit one
    (I guess two versions of the routine will be necessary)?

    Can anybody help with code, please? I managed to reckon that
    the division will be equivalent to an integer division where
    the dividend is shifted 32bits to the left, and the quotient
    then is shifted the same amount to the right. But this lengthens
    the division process even more, is there no way to avoid this?

    Better than all, can some asm genious produce some code or
    share some working code? I've spent weeks looking at the GMP
    and other bignum libs code, but I'm more confused than before.

    Thanks a lot!
    Marie from Bozen, Italy
     
    marie, Aug 22, 2006
    #1
    1. Advertisements

  2. marie

    Dave Littell Guest

    Dave Littell, Aug 23, 2006
    #2
    1. Advertisements

  3. marie

    Yousuf Khan Guest

    You're in the wrong group, this is not a programming group. Try
    comp.lang.asm.x86 newsgroup instead.

    Yousuf Khan
     
    Yousuf Khan, Aug 23, 2006
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.