--- portab.h 2003/01/11 14:59:23 1.26.2.6 +++ portab.h 2002/11/23 18:11:58 1.36 @@ -52,7 +52,7 @@ * exception also makes it possible to release a modified version which * carries forward this exception. * - * $Id: portab.h,v 1.26.2.6 2003/01/11 14:59:23 chl Exp $ + * $Id: portab.h,v 1.36 2002/11/23 18:11:58 chl Exp $ * ****************************************************************************/ @@ -71,15 +71,10 @@ #define DPRINTF_MB 0x00000010 #define DPRINTF_COEFF 0x00000020 #define DPRINTF_MV 0x00000040 -#define DPRINTF_RC 0x00000080 #define DPRINTF_DEBUG 0x80000000 /* debug level for this library */ -#ifdef _DEBUG -#define DPRINTF_LEVEL (DPRINTF_RC|0x0000007F) -#else -#define DPRINTF_LEVEL DPRINTF_RC -#endif +#define DPRINTF_LEVEL 0 /* Buffer size for non C99 compliant compilers (msvc) */ #define DPRINTF_BUF_SZ 1024 @@ -115,7 +110,7 @@ | Fallback when using gcc *---------------------------------------------------------------------------*/ -#elif defined(__GNUC__) || defined(__ICC) +#elif defined(__GNUC__) || defined(__ICC__) # define int8_t char # define uint8_t unsigned char @@ -145,9 +140,7 @@ # define CACHE_LINE 32 # define ptr_t uint64_t #else -/* todo: fix cache_line 0 operation */ -# define CACHE_LINE 16 -# define ptr_t uint32_t +# error Architecture not supported. #endif /***************************************************************************** @@ -198,6 +191,7 @@ *---------------------------------------------------------------------------*/ # if defined(ARCH_X86) # define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax +# define EMMS() __asm {emms} static __inline int64_t read_counter(void) { @@ -216,13 +210,7 @@ | msvc unknown architecture *---------------------------------------------------------------------------*/ # else -/* ANSI C version of BSWAP */ -#define BSWAP(x) \ - x = ((((x) & 0xff000000) >> 24) | \ - (((x) & 0x00ff0000) >> 8) | \ - (((x) & 0x0000ff00) << 8) | \ - (((x) & 0x000000ff) << 24)) - +# error Architecture not supported. # endif @@ -232,7 +220,7 @@ * GNU CC compiler stuff ****************************************************************************/ -#elif defined(__GNUC__) || defined(__ICC) /* Compiler test */ +#elif defined(__GNUC__) || defined(__ICC__) /* Compiler test */ /*---------------------------------------------------------------------------- | Common gcc stuff @@ -268,6 +256,7 @@ *---------------------------------------------------------------------------*/ # if defined(ARCH_X86) # define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ); +# define EMMS() __asm__ ("emms\n\t"); static __inline int64_t read_counter(void) { @@ -284,6 +273,7 @@ # elif defined(ARCH_PPC) # define BSWAP(a) __asm__ __volatile__ \ ( "lwbrx %0,0,%1; eieio" : "=r" (a) : "r" (&(a)), "m" (a)); +# define EMMS() static __inline unsigned long get_tbl(void) { @@ -316,6 +306,7 @@ # define BSWAP(a) __asm__ __volatile__ \ ("mux1 %1 = %0, @rev" ";;" \ "shr.u %1 = %1, 32" : "=r" (a) : "r" (a)); +# define EMMS() static __inline int64_t read_counter(void) { unsigned long result; @@ -330,6 +321,7 @@ # define BSWAP(a) \ ((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ (((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) +# define EMMS() static __inline int64_t read_counter(void) { @@ -343,6 +335,7 @@ # define BSWAP(a) \ ((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ (((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) +# define EMMS() static __inline int64_t read_counter(void) { @@ -353,13 +346,7 @@ | XviD + gcc unsupported Architecture *---------------------------------------------------------------------------*/ # else -/* ANSI C version of BSWAP */ -#define BSWAP(x) \ - x = ((((x) & 0xff000000) >> 24) | \ - (((x) & 0x00ff0000) >> 8) | \ - (((x) & 0x0000ff00) << 8) | \ - (((x) & 0x000000ff) << 24)) - +# error Architecture not supported. # endif /* Architecture checking */ /*****************************************************************************