[FFmpeg-devel] [PATCH] Optimization of original IFF codec

Sebastian Vater cdgs.basty
Fri Apr 23 12:38:31 CEST 2010


Okey...

M?ns Rullg?rd a ?crit :
> I disagree.  Multiplication and division is best written as such when
> the compiler is smart enough to generate shifts in the actual output.
>   
Since you're the maintainer, you'll decide...just review my latest patch
on this.
> For bit-masks I agree shifts should be used.  The cases you changed
> were _numbers_, not bit-masks.
>   
Is a thing like:
int flags

and:
char bmask : 4

a bit-mask for you or just the char? The first one representing various
flags as bits, of coz.
> There is no such code in the optimiser.  In of the last stages of
> compilation (in gcc), the RTL representation of the code is matched
> against various patterns defined in the machine description files.
> Each matching pattern then translates into real instructions for a
> code fragment.  A pattern matching integer division will output shift
> instructions, just like the pattern for a shift will.  The executed
> code (in the compiler) is mostly the same.
>   
I trust you for now in this, since I'm no compiler writer... ;-)
> Besides, if trivial things like this are buggy, you should really try
> to find a better compiler.
>   
That's true!
> If your declarations are separated from code by hundreds of lines,
> you're doing something wrong.  In good code, it is also clear from the
> context which variables are integers and which are floats.
>   
Ok, I think we leave that for now, otherwise I'm afraid we'll still
discussing that in year 2063 *gg*

Or to say it the other way, your argumentation is too good, that I can't
really say anything against this. ;-)

Just review the new patch and say what I should correct (if anything)
and I'll do that without comments.

-- 

Best regards,
                   :-) Basty/CDGS (-:




More information about the ffmpeg-devel mailing list