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

Zuxy Meng zuxy.meng at gmail.com
Fri May 11 12:52:12 CEST 2007


Hi,

2007/5/8, Trent Piepho <xyzzy at speakeasy.org>:
> On Tue, 8 May 2007, Reimar Doeffinger wrote:
> > 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...
> > How about using mov instead of push and decrement the stack directly
> > before the call? Would that make the code larger?
>
> Isn't it possible for something to get clobbered if you write past the end
> of the stack?

No it won't if u do it carefully:-)

> You could make the function regparm(3), then it could pass all the
> arguments in registers and not even use the stack.

Would it make things more complicated due to different ABI between x86
and x86-64?

-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6



More information about the MPlayer-dev-eng mailing list