31 |
|
|
32 |
#define EMMS() __asm {emms} |
#define EMMS() __asm {emms} |
33 |
|
|
34 |
|
#define CACHE_LINE 16 |
35 |
|
#if _MSC_VER <= 1200 |
36 |
|
#define CACHE_ALIGN |
37 |
|
#else |
38 |
|
#define CACHE_ALIGN __declspec(align(CACHE_LINE)) |
39 |
|
#endif |
40 |
|
|
41 |
// needed for bitstream.h |
// needed for bitstream.h |
42 |
#define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax |
#define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax |
43 |
|
|
59 |
|
|
60 |
#elif defined(LINUX) || defined(DJGPP) |
#elif defined(LINUX) || defined(DJGPP) |
61 |
|
|
62 |
|
|
63 |
|
#ifdef _DEBUG |
64 |
|
|
65 |
#include <stdio.h> |
#include <stdio.h> |
66 |
#define DEBUG_WHERE stdout |
#define DEBUG_WHERE stdout |
67 |
#define DEBUG(S) fprintf(DEBUG_WHERE, "%s\n", (S)); |
#define DEBUG(S) fprintf(DEBUG_WHERE, "%s\n", (S)); |
69 |
#define DEBUG2(S,A,B) fprintf(DEBUG_WHERE, "%s%i=%i\n", (S), (A), (B)) |
#define DEBUG2(S,A,B) fprintf(DEBUG_WHERE, "%s%i=%i\n", (S), (A), (B)) |
70 |
#define DEBUG3(S,A,B,C) fprintf(DEBUG_WHERE, "%s %i %x %x\n", (S), (A), (B), (C)) |
#define DEBUG3(S,A,B,C) fprintf(DEBUG_WHERE, "%s %i %x %x\n", (S), (A), (B), (C)) |
71 |
#define DEBUG8(S,A,B,C,D,E,F,G,H) |
#define DEBUG8(S,A,B,C,D,E,F,G,H) |
72 |
|
#else |
73 |
|
#define DEBUG(S) |
74 |
|
#define DEBUG1(S,I) |
75 |
|
#define DEBUG2(X,A,B) |
76 |
|
#define DEBUG3(X,A,B,C) |
77 |
|
#define DEBUG8(X,A,B,C,D,E,F,G,H) |
78 |
|
#endif |
79 |
|
|
80 |
|
#define CACHE_LINE 16 |
81 |
|
#define CACHE_ALIGN __attribute__ ((__aligned__(CACHE_LINE))) |
82 |
|
|
83 |
|
|
84 |
#if defined(LINUX) |
#if defined(LINUX) |
85 |
|
|
98 |
|
|
99 |
#endif |
#endif |
100 |
|
|
|
#define EMMS() __asm__("emms\n\t") |
|
101 |
|
|
102 |
// needed for bitstream.h |
// needed for bitstream.h |
103 |
|
#ifdef ARCH_PPC |
104 |
|
#define BSWAP(a) __asm__ ( "lwbrx %0,0,%1; eieio" : "=r" (a) : \ |
105 |
|
"r" (&(a)), "m" (a)); |
106 |
|
#define EMMS() |
107 |
|
#else |
108 |
#define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ) |
#define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ) |
109 |
|
#define EMMS() __asm__("emms\n\t") |
110 |
|
#endif |
111 |
|
|
112 |
// needed for timer.c |
// needed for timer.c |
113 |
static __inline int64_t read_counter() { |
static __inline int64_t read_counter() { |
143 |
return 0; |
return 0; |
144 |
} |
} |
145 |
|
|
146 |
|
#define CACHE_LINE 16 |
147 |
|
#define CACHE_ALIGN |
148 |
|
|
149 |
#endif |
#endif |
150 |
|
|
151 |
#endif // _PORTAB_H_ |
#endif // _PORTAB_H_ |