[MPlayer-dev-eng] [PATCH] mp3lib: Align output so that movaps can be used instead of movups
Zuxy Meng
zuxy.meng at gmail.com
Tue Jun 5 03:06:07 CEST 2007
Hi,
2007/6/5, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Mon, Jun 04, 2007 at 10:24:48PM +0800, Zuxy Meng wrote:
> > OK. Static is dropped because:
> > 1. mingw32 binutils have some problems in aligning static variables
> > defined in a brace-enclosed block.
>
> That is not a good reason because
> 1) It's a bug in binutils (though why binutils? After the compiler the
> output should not really look much different if it's in a block or at
> global visibility??). Also by just removing it you are making them stack
> variables, and gcc definitely doesn't guarantee alignment for these
> either. So this is only a reason to make them global (though like that
> the thread safety issues remain).
I'm not 100% sure about the root cause. But keeping them static makes
the executable crash. Other static variables work fine so I can only
assume that. Actually GCC does a job in aligning stack variables when
single threaded and not interfered by another compiler, and other
parts of mplayer already heavily relies on this feature.
> > 2. storing those temporary variables as non-static is actually faster.
> > (possibly due to better data locality?)
>
> Is it also faster after the alignment part of the patch?
Of course. Together they bring about ~2.5% speed up. This alone
contributes about 1%. All measured with ffmpeg's
START_TIMER/STOP_TIMER macro.
> How about aligning by 64 bytes instead of 16?
Err...my binuils can't do that.
--
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6
More information about the MPlayer-dev-eng
mailing list