[FFmpeg-devel] [PATCH 2/2] configure: Use intel math.h header.

Hendrik Leppkes h.leppkes at gmail.com
Sat May 10 20:30:39 CEST 2014

On Sat, May 10, 2014 at 7:44 PM, Matt Oliver <protogonoi at gmail.com> 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.

I doubt there is actual exceptions in the compiler for any particular
header, more likely those other compilers are smart enough to know
that 0 * inf is not 0.
Its not the first case of ICL being overzealous and its "optimization"
causing problems.

Is an ICL build even faster than a GCC build? Or why are you using it?
MSVC builds are significantly slower than GCC builds, even if I
disable inline assembly in the GCC build - and in my experience ICL
doesn't provide *that* much of a bonus.

- Hendrik

More information about the ffmpeg-devel mailing list