On Thu, Nov 01, 2001 at 08:26:59PM +1100, Erik de Castro Lopo wrote: > Hi all, > > I have recently written a paper titled "Faster Floating Point to Integer Conversions" > which can be read here: > > http://mega-nerd.com/FPcast/ > > From the introduction: > > In many applications such as audio, video and graphics processing, calculations > are done with floating point values and the final results converted to integer. > There are a number of ways of converting from floating point to integer with the > C cast mechanism being the most commonly used. Unfortunately, casting from float > or double to int on i386 can cause large performance hits when this operation > is used frequently. > > If the programmer considers the speed of the operation more important that the > type of conversion between float and int, speed improvements of 6 to 10 times can > be achieved on Pentium III and Athlon CPUs. It is highly likely this is also the > case on other processors such as PowerPC. > > This paper investigates the reasons why the C cast operation which is so >important > for many applications is so slow and provides an alternative which aims to be > as portable as possible. > > Hope people find this useful.
That's very helpful, looks like a lot of work has been put into it. Thanks :) Daniel. -- *-* Daniel Venkitachalam [EMAIL PROTECTED] University of Western Australia www.ecel.uwa.edu.au/~dvenkita .... . . . . . . . . . . . ___________________________________________________________________________
