[FFmpeg-devel] [PATCH 02/12] mips/float_dsp: replace assembly with C implementations

Nedeljko Babic Nedeljko.Babic at imgtec.com
Wed Mar 4 12:18:56 CET 2015


>>The assembly versions have a few problems
>>- They only work with mips32r2 enabled
>>- They don't work on 64-bits
>>- They're massive and complex
>>
>>So replace them with C implementations which solve these problems and let GCC
>>magically optimize for different platforms. All the functions are manually
>>unrolled 4 times (like the assembly code). With the addition of a few restrict
>>keywords, the functions produce almost identical assembly to the original
>>versions when compiled with gcc -O3.
>>
>>Since this code now uses no fpu assembly, drop the HAVE_MIPSFPU guard as well.
>
>All improvements of the C code should be put in generic C code so all architectures
>can benefit from them.
>
>The purpos of this code was to create optimizations for specific architecture.
>In this way optimizations for mips32r2 architecture are here even without tweaking
>configure line and even for older compilers.
>
>By putting these optimizations under HAVE_MIPS32R2 problem with building mips64 should
>be resolved and this can be optimized for mips64 later if needed.

On the other hand, it looks that there is a bug in here somewhere (in optimizations,
not in your changes).

I'll have to look a little bit in to it...

-Nedeljko


More information about the ffmpeg-devel mailing list