[MPlayer-dev-eng] [PATCH] mp3lib: keep stack 16-byte aligned in synth_1to1_MMX_s

Zuxy Meng zuxy.meng at gmail.com
Tue May 8 10:45:16 CEST 2007


Hi,

2007/5/8, Reimar Doeffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Tue, May 08, 2007 at 11:22:50AM +0800, Zuxy Meng wrote:
> > By default gcc aligns the stack on a 16-byte boundary, and Mac OS X
> > for x86 even mandates this. Hence the patch.
>
> >  ".L02:\n\t"
> >       "emms\n\t"
> > -        "pushl %0\n\t"
> > +     "movl %0, %%eax\n\t"
> > +     "subl $4, %%esp\n\t"
> > +     "pushl %%eax\n\t"
>
> Why do you use eax? I guess %0 breaks otherwise...

Well, actually I don't have a choice here: all others are occupied,
eax is the only one left to me...

> How about using mov instead of push and decrement the stack directly
> before the call? Would that make the code larger?

That's equivalent: %0 is a parameter passed on the stack on x86 and
you have to move it to some register before copying it to another
place on the stack.

Anyway I don't see much benefit in using inline assembly in generic
code like this. Maybe we should backtranslate this piece to C, and
keep only the MMX assembly. This makes it easier to be ported to
x86-64, too.
-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6



More information about the MPlayer-dev-eng mailing list