[Mplayer-cvslog] CVS: main/mp3lib Makefile,1.32,1.33 dct64_altivec.c,1.1,1.2

Arpi of Ize arpi at mplayerhq.hu
Mon Jan 27 22:47:28 CET 2003


Update of /cvsroot/mplayer/main/mp3lib
In directory mail:/var/tmp.root/cvs-serv17684/mp3lib

Modified Files:
	Makefile dct64_altivec.c 
Log Message:
The two attached patches *should* allow for proper
compilation of the AltiVec stuff on both Darwin
and non-Darwin system. They've only been tested
for compilation on Debian using Debian's gcc-3.2.
Romain Dolbeau <dolbeau at irisa.fr>


Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/mp3lib/Makefile,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- Makefile	18 Jan 2003 19:28:53 -0000	1.32
+++ Makefile	27 Jan 2003 21:47:25 -0000	1.33
@@ -26,7 +26,11 @@
 ifeq ($(TARGET_ALTIVEC),yes)
 SRCS += dct64_altivec.c
 OBJS += dct64_altivec.o
+ifeq ($(TARGET_OS),Darwin)
 CFLAGS += -faltivec
+else
+CFLAGS += -maltivec -mabi=altivec
+endif
 endif
 endif
 

Index: dct64_altivec.c
===================================================================
RCS file: /cvsroot/mplayer/main/mp3lib/dct64_altivec.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dct64_altivec.c	18 Jan 2003 19:28:53 -0000	1.1
+++ dct64_altivec.c	27 Jan 2003 21:47:25 -0000	1.2
@@ -13,6 +13,10 @@
 
 #ifdef HAVE_ALTIVEC
 
+#ifndef SYS_DARWIN
+#include <altivec.h>
+#endif
+
 // used to build registers permutation vectors (vcprm)
 // the 's' are for words in the _s_econd vector
 #define WORD_0 0x00,0x01,0x02,0x03
@@ -24,7 +28,11 @@
 #define WORD_s2 0x18,0x19,0x1a,0x1b
 #define WORD_s3 0x1c,0x1d,0x1e,0x1f
 
+#ifdef SYS_DARWIN
 #define vcprm(a,b,c,d) (const vector unsigned char)(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d)
+#else
+#define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d}
+#endif
 
 // vcprmle is used to keep the same index as in the SSE version.
 // it's the same as vcprm, with the index inversed
@@ -36,7 +44,17 @@
 #define FLOAT_n -1.
 #define FLOAT_p 1.
 
+#ifdef SYS_DARWIN
 #define vcii(a,b,c,d) (const vector float)(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d)
+#else
+#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
+#endif
+
+#ifdef SYS_DARWIN
+#define FOUROF(a) (a)
+#else
+#define FOUROF(a) {a,a,a,a}
+#endif
 
 void dct64_altivec(real *a,real *b,real *c)
 {
@@ -47,7 +65,7 @@
   real *out1 = b;
   real *samples = c;
 
-  const vector float vczero = (const vector float)(0.);
+  const vector float vczero = (const vector float)FOUROF(0.);
   const vector unsigned char reverse = (const vector unsigned char)vcprm(3,2,1,0);
 
 
@@ -521,5 +539,5 @@
   out1[0x10*15] = b1[0x1F];
 }
 
-#endif HAVE_ALTIVEC
+#endif /* HAVE_ALTIVEC */
 



More information about the MPlayer-cvslog mailing list