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

Guillaume POIRIER poirierg at gmail.com
Sun Mar 9 15:24:43 CET 2008


Hello,

On Sun, Mar 9, 2008 at 11:42 AM, Reimar Döffinger
<Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> 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.?

I tested it on MacIntel, OSX 10.4.11, and it seems to work alright.

Guillaume
-- 
A soldier will fight long and hard for a bit of colored ribbon.
 -- Napoleon Bonaparte



More information about the MPlayer-dev-eng mailing list