[MPlayer-dev-eng] [PATCH] Mask misaligned exception on K10

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Mar 9 11:42:48 CET 2008


On Sun, Mar 09, 2008 at 06:05:17PM +0800, Zuxy Meng wrote:
> K10 allows for misaligned access of SSE instructions. The attached
> patch enables this feature. Hopefully it can avoid some mysterious
> crashes (as in http://lists.mplayerhq.hu/pipermail/mplayer-users/2008-March/072115.html)
> caused either by buggy code or buggy compilers.

I very much dislike this, now instead of mysterious crashes we get
mysterious performance problems, this is just the equivalent of sweeping
the dust under the carpet.

> +/* Mask the SSE misaligned exception so as to avoid some mysterious
> + * crashes; currently only available on AMD K10.
> + */
> +static void mask_misalign_sse()
> +{
> +	unsigned mxcsr;
> +	asm volatile (
> +			"stmxcsr %0\n\t"
> +			"orl $(1 << 17), %0\n\t"
> +			"ldmxcsr %0\n\t"
> +			:"=m"(mxcsr)
> +		     );
> +}

I do not like the indentation, but more importantly I've never seen <<
used in asm before, are you sure that works with ICC, Apples binutils
etc.?



More information about the MPlayer-dev-eng mailing list