[FFmpeg-devel] [Ffmpeg-devel] [PATCH] detect support for 10 operands in configure

Loren Merritt lorenm
Mon Feb 9 20:36:54 CET 2009


On Mon, 9 Feb 2009, Diego Biurrun wrote:

> I think this is the proper solution for the gcc 2.95 breakage that just
> occurred.  Probably there is a better way to write the check, but it
> seems to work and I know no Assembler.

Your patch implicitly checks have_7regs too.

--Loren Merritt
-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 17097)
+++ configure	(working copy)
@@ -898,6 +900,7 @@
     sys_select_h
     sys_soundcard_h
     sys_videoio_h
+    ten_operands
     termios_h
     threads
     truncf
@@ -1778,6 +1782,19 @@
     # check wether EBX is available on x86
     check_asm ebx_available '"":::"%ebx"'
 
+    # check whether more than 10 operands are supported
+    check_cc -O1 <<EOF && enable ten_operands
+int main(void)
+{
+    int x=0;
+    __asm__ volatile(
+        "nop\n"
+        :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
+    );
+    return 0;
+}
+EOF
+
     # check whether binutils is new enough to compile SSSE3/MMX2
     enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
     enabled mmx2  && check_asm mmx2  '"movss %xmm0, %xmm0"'
@@ -2184,6 +2202,7 @@
     echo "CMOV is fast              ${fast_cmov-no}"
     echo "EBX available             ${ebx_available-no}"
     echo "EBP available             ${ebp_available-no}"
+    echo "10 operands supported     ${ten_operands-no}"
 fi
 if enabled arm; then
     echo "ARMv5TE enabled           ${armv5te-no}"
Index: libavcodec/x86/dsputil_mmx.c
===================================================================
--- libavcodec/x86/dsputil_mmx.c	(revision 17097)
+++ libavcodec/x86/dsputil_mmx.c	(working copy)
@@ -548,7 +548,7 @@
         dst[i] = src1[i] + src2[i];
 }
 
-#if HAVE_7REGS
+#if HAVE_7REGS && HAVE_TEN_OPERANDS
 static void add_hfyu_median_prediction_cmov(uint8_t *dst, uint8_t *top, uint8_t *diff, int w, int *left, int *left_top) {
     x86_reg w2 = -w;
     x86_reg x;
@@ -2799,7 +2799,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
 #if HAVE_YASM
             c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_mmx2;
 #endif
-#if HAVE_7REGS
+#if HAVE_7REGS && HAVE_TEN_OPERANDS
             if( mm_flags&FF_MM_3DNOW )
                 c->add_hfyu_median_prediction = add_hfyu_median_prediction_cmov;
 #endif



More information about the ffmpeg-devel mailing list