[linux-audio-dev] Fixed vs Floating point comparison.
Jussi Laako
jussi.laako at pp.inet.fi
Thu Nov 27 19:05:52 UTC 2003
> > 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.
Numbers for AMD Opteron 244 system (fistl changed to lrint()):
jussi/own> time ./resamp_fixp
1.037u 0.000s 0:01.03 100.0% 0+0k 0+0io 76pf+0w
jussi/own> time ./resamp_float
1.970u 0.000s 0:01.96 100.5% 0+0k 0+0io 76pf+0w
jussi/own> time ./resamp_float_fistl
4.034u 0.001s 0:04.03 100.0% 0+0k 0+0io 90pf+0w
--
Jussi Laako <jussi.laako at pp.inet.fi>
More information about the Linux-audio-dev
mailing list