[FFmpeg-devel] [PATCH] runtime cpu detection for emms

Ronald S. Bultje rsbultje
Mon Aug 30 13:30:21 CEST 2010


Hi,

2010/8/29 M?ns Rullg?rd <mans at mansr.com>:
>> +static void emms_null(void) ?{ }
>> +static void emms_mmx(void) ? { __asm__ volatile ("emms;":::"memory"); }
>> +static void emms_init(void)
>> +{
>> + ? ?ff_emms = mm_support() & FF_MM_MMX ? emms_mmx : emms_null;
>> + ? ?ff_emms();
>> +}
>> +void (*ff_emms)(void) = emms_init;
>
> This is worse than the original.

We can put the original back if you prefer that...

Aurelien is right that we need some sort of runtime CPU detection, at
the very least under #ifdef HAVE_RUNTIME_CPUDETECT (and then the else
can be a non-function-pointerish direct call to emms), and this might
be OK for that purpose.

Ronald



More information about the ffmpeg-devel mailing list