[MPlayer-dev-eng] [PATCH] libvo/aclib_template.c small_memcpy wrong??

Michael Niedermayer michaelni at gmx.at
Mon Feb 20 19:56:53 CET 2006


Hi

On Mon, Feb 20, 2006 at 06:32:53PM +0100, Reimar Döffinger wrote:
> Hi,
> On Mon, Feb 20, 2006 at 02:52:50PM +0200, Ivan Kalvachev wrote:
> > 2005/12/5, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> > > here is an untested patch for $SUBJECT, which I think is broken. What is
> > > that dummy variable supposed to be? It is never initialized. Also
> > > without cld the copy might go off in the wrong direction and cause a
> > > segfault.
> > 
> > Read the comment, this variable is not input one, but output. This
> > means that the ECX will be stored in it. The point is we don't want to
> > waste time for storing it. On the other side the delta var is also
> > temporal...
> 
> This does not answer the question how this is supposed to work
> since ecx is not initialized...

if that where true then why doesnt it segfault?

for the awnser look at the code not the patch:

__asm__ __volatile__(\
        "rep; movsb"\
        :"=&D"(to), "=&S"(from), "=&c"(dummy)\
/* It's most portable way to notify compiler */\
/* that edi, esi and ecx are clobbered in asm block. */\
/* Thanks to A'rpi for hint!!! */\
        :"0" (to), "1" (from),"2" (n)\
        : "memory");\

[...]
-- 
Michael




More information about the MPlayer-dev-eng mailing list