[FFmpeg-devel] [PATCH 2/2] Don't use CMOV in MMX code

Mikulas Patocka mikulas at artax.karlin.mff.cuni.cz
Fri Sep 12 21:50:32 CEST 2014


There are MMX processors that don't support CMOV (pentium-mmx, amd-k6, cyrix
6x86). Therefore, we must not use cmov in in MMX code.

All processors supporing mmx2 also support cmov, so if a test for mmx2 succeeds,
we can use cmov.

---
 libavcodec/x86/h264_idct.asm |    6 ++++++
 1 file changed, 6 insertions(+)

Index: ffmpeg/libavcodec/x86/h264_idct.asm
===================================================================
--- ffmpeg.orig/libavcodec/x86/h264_idct.asm	2014-08-25 03:59:06.376569389 +0200
+++ ffmpeg/libavcodec/x86/h264_idct.asm	2014-08-25 18:47:46.988574579 +0200
@@ -1063,7 +1063,13 @@ cglobal h264_luma_dc_dequant_idct, 3, 4,
     add        t3d, 128 << 16
     mov        t1d, 7
     cmp        t0d, t1d
+%if cpuflag(mmx2)
     cmovg      t0d, t1d
+%else
+    jng	.skip_mov
+    mov        t0d, t1d
+.skip_mov:
+%endif
     inc        t1d
     shr        t3d, t0b
     sub        t1d, t0d



More information about the ffmpeg-devel mailing list