--- portab.h 2002/03/16 22:28:37 1.3 +++ portab.h 2002/03/21 13:44:29 1.5 @@ -31,6 +31,9 @@ #define EMMS() __asm {emms} +#define CACHE_LINE 16 +#define CACHE_ALIGN __declspec(align(CACHE_LINE)) + // needed for bitstream.h #define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax @@ -70,6 +73,9 @@ #define DEBUG8(X,A,B,C,D,E,F,G,H) #endif +#define CACHE_LINE 16 +#define CACHE_ALIGN + #if defined(LINUX) #include @@ -87,10 +93,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() { @@ -126,6 +138,9 @@ return 0; } +#define CACHE_LINE 16 +#define CACHE_ALIGN + #endif #endif // _PORTAB_H_