--- portab.h 2002/03/20 14:02:48 1.4 +++ portab.h 2002/03/25 20:01:54 1.7 @@ -32,7 +32,11 @@ #define EMMS() __asm {emms} #define CACHE_LINE 16 +#if _MSC_VER <= 1200 +#define CACHE_ALIGN +#else #define CACHE_ALIGN __declspec(align(CACHE_LINE)) +#endif // needed for bitstream.h #define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax @@ -74,7 +78,8 @@ #endif #define CACHE_LINE 16 -#define CACHE_ALIGN +#define CACHE_ALIGN __attribute__ ((__aligned__(CACHE_LINE))) + #if defined(LINUX) @@ -93,10 +98,16 @@ #endif -#define EMMS() __asm__("emms\n\t") // needed for bitstream.h -#define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ) +#ifdef ARCH_PPC + #define BSWAP(a) __asm__ ( "lwbrx %0,0,%1; eieio" : "=r" (a) : \ + "r" (&(a)), "m" (a)); + #define EMMS() +#else + #define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ) + #define EMMS() __asm__("emms\n\t") +#endif // needed for timer.c static __inline int64_t read_counter() {