[linux-audio-dev] Fixed vs Floating point comparison.

Erik de Castro Lopo erikd-lad at mega-nerd.com
Fri Oct 17 08:50:53 UTC 2003


On Thu, 16 Oct 2003 20:09:13 -0300
Juan Linietsky <coding at reduz.com.ar> wrote:

> The code is available at:
> http://reduz.dyndns.org/resamp_fixp.c // fixed point version
> http://reduz.dyndns.org/resamp_float.c // floating point version, portable
> http://reduz.dyndns.org/resamp_float_fistl.c // X86 VERSION ONLY!! Uses fistl 
> instruction

Any code which uses the X86 fistl instruction can be rewritten to use the 
ISO 1999 C standard function lrint() and lrintf() to produce nearly exactly
the same code (ie on X86 lrint() becomes fistl instruction).

However, lrint() and lrintf() are portable across all architectures.

Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  nospam at mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"The Internet interprets censorship as damage, and routes around it."
  -- John Gilmore



More information about the Linux-audio-dev mailing list