Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: fast normalization

Author: Robert Hyatt

Date: 08:30:13 10/31/03

Go up one level in this thread


On October 31, 2003 at 11:08:43, Charles Roberson wrote:

>>>     Algebra allows factoring out the 100/largest and creating a loop invariant
>>>  constant. However, largest can be very big and we are using integer
>>>  arithmetic. Thus, a large largest can make 100/largest = 0.
>>
>>
>>make 100/largest a float.  let number stay an integer.  You end up with
>>an integer result that will be what you expect.
>
>   A good suggestion, but I was trying to avoid floating point arithmatic.
>   Are you suggesting that FP multiplication is faster than my stated
>   algorithm?

Not particularly.  I was just stating that FP is not that bad on today's
hardware.  The FP multiply will be done in parallel with other loop work,
so it might not cost a thing, since the FP unit is completely separate.


>
>      The slow possibility is in the HighOrderBit() function. After that
>    shift right is fast. Seems one call to HighOrderBit() would be faster
>    than many FP multiplies.

Possibly.  I'd have to look at the .asm output of the compiler to see what
it really does..




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.