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:13:28 EET


It really blew my mind when Fred Gleason <fredg_AT_wava.com> said:

> On Thu, 1 Nov 2001, Paul Davis wrote:
>
> > 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.
>
> Perhaps this is a naive question, but shouldn't we be having this
> discussion with the maintainers of egcs/gcc? Methinks the easiest way to
> handle this would be to optimize the cast mechanism to work properly with
> Intel hardware.

To meet the C specs the processor has to be in one mode for cast and another
mode to ALL other calculations. That means you have to switch.

To fix this you have to either fix the C spec or the i386 architecture. I
personally think it would be easier to fix the i386 arch :-).

Erik

-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  nospam_AT_mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
" ... new TV ad for Microsoft's Internet Explorer e-mail program which 
uses the musical theme of the "Confutatis Maledictis" from Mozart's 
Requiem. "Where do you want to go today?" is the cheery line on the 
screen, while the chorus sings "Confutatis maledictis, flammis acribus
addictis,". This translates to "The damned and accursed are convicted
to the flames of hell."


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:10:10 EET