[FFmpeg-devel] [RFC] Loop unrolling in C code for 'vector_fmul_*' functions

Loren Merritt lorenm
Fri Jan 11 00:54:45 CET 2008

On Fri, 11 Jan 2008, mark cox wrote:
> On Jan 11, 2008 7:39 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> Add a assert((len & 7) == 0); and the compiler can know it.
> That is a really interesting statement. are you saying that gcc will
> optimize by adding such an assert? This is the first i have heard of this.
> such code annotations could probably help in many places.

No, he's saying that the information is then available to the compiler, 
so the above advice about complaining to the gcc devs about suboptimal 
code applies.

But gcc certainly does apply some such optimizations, if not specifically 
assert. e.g. if you dereference a pointer and then test its truth, the 
test will be optimized away because it's a constant if the dereference 
didn't crash.

--Loren Merritt

More information about the ffmpeg-devel mailing list