[FFmpeg-devel] [RFC] Loop unrolling in C code for 'vector_fmul_*' functions
Måns Rullgård
mans
Fri Jan 11 01:33:04 CET 2008
Loren Merritt <lorenm at u.washington.edu> writes:
> 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.
Is it wise to assume that dereferencing a null pointer will crash?
This is certainly not true on many MMU-less systems. Even some old
Unix versions (AIX, HP-UX or both, I forget which) allowed reading of
address 0.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list