Re: [linux-audio-dev] Float to int conversions

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Float to int conversions
From: Paul Davis (pbd_AT_Op.Net)
Date: Thu Nov 01 2001 - 14:54:32 EET


>I have recently written a paper titled "Faster Floating Point to Integer Conve
>rsions"
>which can be read here:
>
> http://mega-nerd.com/FPcast/

nice work. but i have a question: your timings how that lrintf and
lrint basically take nearly twice as long as the optimal asm macro. if
you're writing a program in which float<->int conversion is a
significant issue, why would you move from the cast solution (which is
obviously bad) to one thats only half as good as it could be?

many other platforms (e.g. MIPS) do float<->int phenomenally well just
via a cast. it seems to me that it would be "cleverer" to define a
portable solution, if you're going to be willing to use autoconf, that
defines FLOAT_TO_INT, but make it platform specific and possibly a
no-op if the platform's cast does the job properly.

did you consider this?

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Nov 01 2001 - 14:51:29 EET