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: Erik de Castro Lopo (erikd-lad_AT_mega-nerd.com)
Date: Thu Nov 01 2001 - 21:03:10 EET


It really blew my mind when Steve Harris <S.W.Harris_AT_ecs.soton.ac.uk> said:

> 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/
>
> How do the techniques here compare to the bit mangling version that I
> posted earlier? It is portable to all 32bit IEEE float systems.

I tested this early on in the testing process and then discarded your
method as it was than pulling the float apart with the integer pipeline.

By multiplying with that very large constant I believe you end up with
number that cannot be properly represented by the 32 bits. When forces to
handle these weird numbers (like de-normailised numbers) the FPU takes
longer to do its stuff yhan normal.

But the benchmarking code is there if you'd like to prove it :-).

Erik

-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  nospam_AT_mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"Using Java as a general purpose application development language 
is like going big game hunting armed with Nerf weapons." 
-- Author Unknown


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 - 21:01:28 EET