[FFmpeg-devel] [PATCH 2/2] configure: Use intel math.h header.
michaelni at gmx.at
Sat May 10 20:18:51 CEST 2014
On Sun, May 11, 2014 at 03:44:23AM +1000, Matt Oliver wrote:
> On 11 May 2014 03:03, Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:
> > On 07.05.2014, at 15:52, Matt Oliver <protogonoi at gmail.com> wrote:
> > > icl when run under msvc12 currently generates incorrect code. This is due
> > > to an issue with msvc12's C99 additions to math.h. Several defines in
> > > msvc's math.h are not compatible with icl and will compile but generate
> > > erroneous results during runtime. An obvious example is that NAN from
> > > math.h evaluates to 0.0 under icl which is clearly not a correct value
> > for
> > > NaN. This cause several errors that completly break FFmpeg.
> > >
> > > There are several ways to fix this. 1) Force icl's floating point
> > > compliance but negatively impact performance in doing so. 2) Add compiler
> > > specific code into FFmpeg or 3) Have icl use its own native math header
> > > (which can also improve performance).
> > To be honest I find this quite ridiculous.
> > Almost two years should be enough for Intel to get the standard system
> > headers to work correctly.
> > Or to put it differently: Using ICL starts to sound like a horribly bad
> > idea if it already miscompiles basic system headers, which in turn IMHO
> > raises some questions how many hacks we should accept for it.
> True, Im amazed this hasnt been an issue more often. Im guessing most
> people with icl will use the icl header and the rest just havnt noticed the
> problem. The exact issue is that the msvc headers define NAN as ( INFINITY
> * 0.0 ) which the optimizers in icl just replace with 0. So it will work
> fine if you disable optimization and force floating point compliance but
> this defeats the purpose of an optimizing compiler like icl and whats the
> point of a release build if it cant even be compiled using -O2. Optimizing
> out multiplies by zero is standard procedure by all compilers not just icl
> so im not sure whos to blame here intel or microsoft. Msvc also optimizes
The values you quote are known at compile time, theres nothing to
optimize out here. There would be no *0 at runtime either way
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have often repented speaking, but never of holding my tongue.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-devel