]> granicus.if.org Git - libx264/commitdiff
Fix crash on new AMD M300 and similar CPUs
authorFiona Glaser <fiona@x264.com>
Mon, 18 Jan 2010 23:50:06 +0000 (15:50 -0800)
committerFiona Glaser <fiona@x264.com>
Thu, 21 Jan 2010 04:42:17 +0000 (20:42 -0800)
Apparently these CPUs have SSE4a, but not misaligned SSE.

common/cpu.c

index 757163d24b73c74c7233ae378f2340fa5cd49290..0f0bd7814b8fe7f3116e4b0970d7d16b38167b26 100644 (file)
@@ -143,13 +143,17 @@ uint32_t x264_cpu_detect( void )
             if( ecx&0x00000040 ) /* SSE4a */
             {
                 cpu |= X264_CPU_SSE2_IS_FAST;
-                cpu |= X264_CPU_SSE_MISALIGN;
                 cpu |= X264_CPU_LZCNT;
                 cpu |= X264_CPU_SHUFFLE_IS_FAST;
-                x264_cpu_mask_misalign_sse();
             }
             else
                 cpu |= X264_CPU_SSE2_IS_SLOW;
+
+            if( ecx&0x00000080 ) /* Misalign SSE */
+            {
+                cpu |= X264_CPU_SSE_MISALIGN;
+                x264_cpu_mask_misalign_sse();
+            }
         }
     }