[MPlayer-cvslog] r21056 - in trunk/mp3lib: Makefile dct64_sse.c decod386.c decode_MMX.c sr1.c

nplourde subversion at mplayerhq.hu
Sun Nov 19 16:21:51 CET 2006


Author: nplourde
Date: Sun Nov 19 16:21:50 2006
New Revision: 21056

Modified:
   trunk/mp3lib/Makefile
   trunk/mp3lib/dct64_sse.c
   trunk/mp3lib/decod386.c
   trunk/mp3lib/decode_MMX.c
   trunk/mp3lib/sr1.c

Log:
fix mp3lib compilation on OSX

Modified: trunk/mp3lib/Makefile
==============================================================================
--- trunk/mp3lib/Makefile	(original)
+++ trunk/mp3lib/Makefile	Sun Nov 19 16:21:50 2006
@@ -9,9 +9,17 @@
 SRCS = sr1.c
 ifeq ($(TARGET_ARCH_X86_32),yes)
 SRCS += decode_i586.c
+# Darwin can't compile tabinit_MMX.c. However, we need costab_mmx from
+# decode_mmx.c for dct64_sse.c.
+ifeq ($(TARGET_OS),Darwin)
+ifeq ($(TARGET_MMX),yes)
+SRCS += decode_MMX.c
+endif
+else
 ifeq ($(TARGET_MMX),yes)
 SRCS += decode_MMX.c dct64_MMX.c tabinit_MMX.c
 endif
+endif
 ifeq ($(TARGET_3DNOW),yes)
 SRCS += dct36_3dnow.c dct64_3dnow.c
 endif

Modified: trunk/mp3lib/dct64_sse.c
==============================================================================
--- trunk/mp3lib/dct64_sse.c	(original)
+++ trunk/mp3lib/dct64_sse.c	Sun Nov 19 16:21:50 2006
@@ -298,6 +298,13 @@
        To do saturation efficiently in x86 we can use fist(t)(p),
        pf2iw, or packssdw. We use fist(p) here.
     */
+
+#ifdef SYS_DARWIN
+#define FFREEP "fstp %%st(0)\n\t"
+#else
+#define FFREEP "ffreep %%st(0)\n\t"
+#endif /* SYS_DARWIN */
+
     asm(
         "flds       %0\n\t"
         "flds     (%2)\n\t"
@@ -426,7 +433,7 @@
         "fist  480(%4)\n\t"
         "fadds  92(%1)\n\t"
         "fistp 416(%4)\n\t"
-        "ffreep %%st(0)\n\t"
+        FFREEP
         :
         :"m"(costab_mmx[30]), "r"(b1), "r"(b2), "r"(a), "r"(b)
         :"memory"

Modified: trunk/mp3lib/decod386.c
==============================================================================
--- trunk/mp3lib/decod386.c	(original)
+++ trunk/mp3lib/decod386.c	Sun Nov 19 16:21:50 2006
@@ -19,6 +19,11 @@
 
 #include "config.h"
 
+/* Can't compile MMX assembly on Darwin */
+#ifdef SYS_DARWIN
+#undef HAVE_MMX
+#endif /* SYS_DARWIN */
+
 #if 0
  /* old WRITE_SAMPLE */
    /* is portable */

Modified: trunk/mp3lib/decode_MMX.c
==============================================================================
--- trunk/mp3lib/decode_MMX.c	(original)
+++ trunk/mp3lib/decode_MMX.c	Sun Nov 19 16:21:50 2006
@@ -48,6 +48,7 @@
 	1060439283,
 };
 
+#ifndef SYS_DARWIN
 static int temp; // buggy gcc 3.x fails if this is moved into the function :(
 void synth_1to1_MMX_s(real *bandPtr, int channel, short *samples,
                       short *buffs, int *bo)
@@ -246,3 +247,4 @@
 	:"m"(bandPtr),"m"(channel),"m"(samples),"m"(buffs),"m"(bo), "m"(temp)
 	:"memory","%edi","%esi","%ebx","%esp");
 }
+#endif /* SYS_DARWIN */

Modified: trunk/mp3lib/sr1.c
==============================================================================
--- trunk/mp3lib/sr1.c	(original)
+++ trunk/mp3lib/sr1.c	Sun Nov 19 16:21:50 2006
@@ -31,6 +31,11 @@
 
 #include "libvo/fastmemcpy.h"
 
+// Can't compile MMX assembly on Darwin
+#ifdef SYS_DARWIN
+#undef HAVE_MMX
+#endif /* SYS_DARWIN */
+
 #ifdef ARCH_X86_32
 #define CAN_COMPILE_X86_ASM
 #endif



More information about the MPlayer-cvslog mailing list