[Mplayer-cvslog] CVS: main/libac3 config.h,NONE,1.1 Makefile,1.3,1.4 bswap.h,1.1.1.1,1.2

Nick Kurshev nickols_k at users.sourceforge.net
Tue May 22 09:45:37 CEST 2001


Update of /cvsroot/mplayer/main/libac3
In directory usw-pr-cvs1:/tmp/cvs-serv8422/main/libac3

Modified Files:
	Makefile bswap.h 
Added Files:
	config.h 
Log Message:
x86 assembler optimization

--- NEW FILE ---
#include "../config.h"

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libac3/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Makefile	2001/05/13 20:26:18	1.3
--- Makefile	2001/05/22 07:45:35	1.4
***************
*** 6,10 ****
  SRCS    = bit_allocate.c bitstream.c coeff.c crc.c debug.c decode.c dither.c exponent.c imdct.c parse.c rematrix.c sanity_check.c srfft.c stats.c $(OPTIONAL_SRCS)
  OBJS    = bit_allocate.o bitstream.o coeff.o crc.o debug.o decode.o dither.o exponent.o imdct.o parse.o rematrix.o sanity_check.o srfft.o stats.o $(OPTIONAL_OBJS)
! CFLAGS  = $(OPTFLAGS) -I. -I..
  
  .SUFFIXES: .c .o
--- 6,10 ----
  SRCS    = bit_allocate.c bitstream.c coeff.c crc.c debug.c decode.c dither.c exponent.c imdct.c parse.c rematrix.c sanity_check.c srfft.c stats.c $(OPTIONAL_SRCS)
  OBJS    = bit_allocate.o bitstream.o coeff.o crc.o debug.o decode.o dither.o exponent.o imdct.o parse.o rematrix.o sanity_check.o srfft.o stats.o $(OPTIONAL_OBJS)
! CFLAGS  = $(OPTFLAGS) -I. -I.. -DHAVE_CONFIG_H
  
  .SUFFIXES: .c .o

Index: bswap.h
===================================================================
RCS file: /cvsroot/mplayer/main/libac3/bswap.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** bswap.h	2001/02/24 20:29:42	1.1.1.1
--- bswap.h	2001/05/22 07:45:35	1.2
***************
*** 18,21 ****
--- 18,59 ----
  #define bswap_64(x) (x)
  #else
+ #ifdef ARCH_X86
+ inline static unsigned short ByteSwap16(unsigned short x)
+ {
+   __asm("xchgb %b0,%h0"	:
+         "=q" (x)	:
+         "0" (x));
+     return x;
+ }
+ #define bswap_16(x) ByteSwap16(x)
+ 
+ inline static unsigned int ByteSwap32(unsigned int x)
+ {
+ #if __CPU__ > 386
+  __asm("bswap	%0":
+       "=r" (x)     :
+ #else
+  __asm("xchgb	%b0,%h0\n"
+       "	rorl	$16,%0\n"
+       "	xchgb	%b0,%h0":
+       "=q" (x)		:
+ #endif
+       "0" (x));
+   return x;
+ }
+ #define bswap_32(x) ByteSwap32(x)
+ 
+ inline static unsigned long long int ByteSwap64(unsigned long long int x)
+ {
+   register union { __extension__ unsigned long long int __ll;
+           unsigned long int __l[2]; } __x;
+   asm("xchgl	%0,%1":
+       "=r"(__x.__l[0]),"=r"(__x.__l[1]):
+       "0"(bswap_32((unsigned long)x)),"1"(bswap_32((unsigned long)(x>>32))));
+   return __x.__ll;
+ }
+ #define bswap_64(x) ByteSwap64(x)
+ 
+ #else
  // This is wrong, 'cannot take address of ...'
  #define bswap_16(x) ((((uint8_t*)&x)[2] << 8) \
***************
*** 35,38 ****
--- 73,77 ----
           __r.__l[1] = bswap_32 (__w.__l[0]);			\
           __r.__ll; }))
+ #endif
  #endif
  


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list