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

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

Subject: Re: [linux-audio-dev] Fixed vs Floating point comparison.
From: Jussi Laako (jussi.laako_AT_pp.inet.fi)
Date: Thu Nov 27 2003 - 21:05:52 EET


> > 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>


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 27 2003 - 21:03:21 EET