Picking good first estimates for Goldschmidt division

前端 未结 3 664
一生所求
一生所求 2021-02-07 08:06

I\'m calculating fixedpoint reciprocals in Q22.10 with Goldschmidt division for use in my software rasterizer on ARM.

This is done by just setting the numerator to 1, i.

3条回答
  •  遥遥无期
    2021-02-07 08:25

    A couple of ideas for you, though none that solve your problem directly as stated.

    1. Why this algo for division? Most divides I've seen in ARM use some varient of
      
            adcs hi, den, hi, lsl #1
            subcc hi, hi, den
            adcs lo, lo, lo
      

    repeated n bits times with a binary search off of the clz to determine where to start. That's pretty dang fast.

    1. If precision is a big problem, you are not limited to 32/64 bits for your fixed point representation. It'll be a bit slower, but you can do add/adc or sub/sbc to move values across registers. mul/mla are also designed for this kind of work.

    Again, not direct answers for you, but possibly a few ideas to go forward this. Seeing the actual ARM code would probably help me a bit as well.

提交回复
热议问题