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

Trent Piepho xyzzy at speakeasy.org
Tue May 8 10:54:14 CEST 2007


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?

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



More information about the MPlayer-dev-eng mailing list