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

Michael Niedermayer michaelni
Tue Sep 21 15:25:12 CEST 2010


On Tue, Sep 21, 2010 at 01:53:37PM +0100, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> 
> > On Tue, Sep 21, 2010 at 11:13:38AM +0100, M?ns Rullg?rd wrote:
> >> Michael Niedermayer <michaelni at gmx.at> writes:
> >> 
> >> > On Tue, Sep 21, 2010 at 10:36:02AM +0100, M?ns Rullg?rd wrote:
> >> >> Michael Niedermayer <michaelni at gmx.at> writes:
> >> >> 
> >> >> >> The function call overhead is exactly the same with yasm or C,
> >> >> >> assuming the C compiler doesn't generate ridiculous prologues and
> >> >> >> epilogues.  Please stop claiming anything else.  Nobody is talking
> >> >> >> about asm that actually gets inlined.
> >> >> >
> >> >> > thats not true, the split asm cases surely where inlined and a 1:1
> >> >> > conversion to yasm would have had additional call overhead.
> >> >> 
> >> >> Nobody ever suggested doing that.  We've always been talking about
> >> >> whole functions, be they written C or yasm.  Now stop making straw man
> >> >> arguments, please.
> >> >
> >> > you talk about optimizing C code to asm and converting inline
> >> > to yasm both in one patch and use it as argument why yasm is better.
> >> > But its the C->asm optimization that makes it better not inline->yasm
> >> 
> >> The split inline asm in the SSE IMDCT could not have been merged.
> >> There was a function call to the FFT between the two parts, and on
> >> x86_64 it is not possible to do a function call from within inline asm
> >> (and it is a bad idea on any arch).  When the entire function is
> >> written in yasm, there is of course no problem with making function
> >> calls.
> >
> > interresting strawman argument
> > noone was talking about cases that cannot easily be done in inline asm
> 
> So why are they split in the first place?

that was mentioned in that thread further up
something between being ok on existing platforms at the time and authors
limited time to convert more C to asm ...


> 
> > not that calling from inline would be impossible or anything
> 
> Calling a function from inline asm on x86_64 (and ppc64) is impossible
> to do safely due to the red zone on the stack.  The compiler must be
> aware of the function call happening, or you will get stack corruption.

i dont see the problem but as said for this case i think yasm is better
so iam not sure what you try to argue here?
We agree yasm is better here alraedy


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- 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/80f3a373/attachment.pgp>



More information about the ffmpeg-devel mailing list