[FFmpeg-devel] [PATCH] update doc/optimization.txt

Michael Niedermayer michaelni
Tue Sep 21 00:14:26 CEST 2010

On Mon, Sep 20, 2010 at 02:13:56PM -0700, Alex Converse wrote:
> On Mon, Sep 20, 2010 at 10:20 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> >
> >
> > I dont mind at all if code is changed to yasm if it is faster or if it is
> > neccessary and the only known clean way to solve a bug.
> > i dont even mind if code is yasm instead of asm() to begin with
> > but changing the code just because someone decided to make a usefull change
> > on top of the yasm code instead of in inline, i really dont like this and i
> > wouldnt like the other way around either, rewriting yasm to inline for no
> > good reason
> > thats just besides that it totally fucks up svn blame and even git blame
> >
> Besides the bugs Ronald mentioned, we were using split asm sections
> and counted on them preserving values between the sections which is
> undefined behavior.

its no bit better if these where split yasm function calls
the problem is the split not the inline vs yasm

> In addition in some cases GCC was unrolling C
> loops around the asm sections which also sucked a ton.

and doc/optimizatioin.txt says since a very long time:
General Tips:
Use asm loops like:
    "1: ....
    "jump_instruciton ....
Do not use C loops:

> Both of these
> situations are possible to fix with inline asm (yasm loops and
> manually stacking variables things) but these mistakes are much harder
> to make in yasm in the first place.

i dont really agree that such mistakes are harder to make in yasm
also depending on mmx/sse registers being preserved was likely done conciously.
It was done at a time when it was safe with existing platforms. The problems
just begun with win64
So IMO this is a before win64 vs. after win64 issue and not at all a inline
vs yasm issue.
With yasm the only reason not to do split asm is that yasm has more overhead
namely for each call so theres another reason besides win64 that pushes
toward not spliting

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100921/e064fecb/attachment.pgp>

More information about the ffmpeg-devel mailing list