12 |
#define DPRINTF_MV 0x00000040 |
#define DPRINTF_MV 0x00000040 |
13 |
#define DPRINTF_DEBUG 0x80000000 |
#define DPRINTF_DEBUG 0x80000000 |
14 |
|
|
15 |
|
|
16 |
|
#ifdef _DEBUG |
17 |
// debug level |
// debug level |
18 |
#define DPRINTF_LEVEL 0 |
#define DPRINTF_LEVEL 0x00000000 |
19 |
|
#else |
20 |
|
#define DPRINTF_LEVEL 0x0 |
21 |
|
#endif |
22 |
|
|
23 |
|
|
24 |
#define DPRINTF_BUF_SZ 1024 |
#define DPRINTF_BUF_SZ 1024 |
110 |
return ts; |
return ts; |
111 |
} |
} |
112 |
|
|
113 |
#elif defined(LINUX) || defined(DJGPP) || defined(FREEBSD) |
#elif defined(LINUX) || defined(DJGPP) || defined(FREEBSD) || defined(BEOS) |
114 |
|
|
115 |
#include <stdio.h> |
#include <stdio.h> |
116 |
#include <stdarg.h> |
#include <stdarg.h> |
148 |
#define DEBUGCBR(A,B,C) |
#define DEBUGCBR(A,B,C) |
149 |
#endif |
#endif |
150 |
|
|
151 |
#if defined(LINUX) |
#if defined(LINUX) || defined(BEOS) |
152 |
|
|
153 |
|
#if defined(BEOS) |
154 |
|
#include <inttypes.h> |
155 |
|
#else |
156 |
#include <stdint.h> |
#include <stdint.h> |
157 |
|
#endif |
158 |
|
|
159 |
#define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \ |
#define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \ |
160 |
type name##_storage[(sizex)*(sizey)+(alignment)-1]; \ |
type name##_storage[(sizex)*(sizey)+(alignment)-1]; \ |
223 |
|
|
224 |
#define EMMS() |
#define EMMS() |
225 |
|
|
226 |
|
#ifdef __GNUC__ |
227 |
|
|
228 |
|
// needed for bitstream.h |
229 |
|
#define BSWAP(a) __asm__ __volatile__ ("mux1 %1 = %0, @rev" \ |
230 |
|
";;" \ |
231 |
|
"shr.u %1 = %1, 32" : "=r" (a) : "r" (a)); |
232 |
|
|
233 |
|
// rdtsc replacement for ia64 |
234 |
|
static __inline int64_t read_counter() { |
235 |
|
unsigned long result; |
236 |
|
|
237 |
|
// __asm__ __volatile__("mov %0=ar.itc" : "=r"(result) :: "memory"); |
238 |
|
// while (__builtin_expect ((int) result == -1, 0)) |
239 |
|
__asm__ __volatile__("mov %0=ar.itc" : "=r"(result) :: "memory"); |
240 |
|
return result; |
241 |
|
|
242 |
|
} |
243 |
|
|
244 |
|
/* we are missing our ia64intrin.h file, but according to the |
245 |
|
Intel's ecc manual, this should be the right way ... |
246 |
|
this |
247 |
|
|
248 |
|
#elif defined(__INTEL_COMPILER) |
249 |
|
|
250 |
|
#include <ia64intrin.h> |
251 |
|
|
252 |
|
static __inline int64_t read_counter() { |
253 |
|
return __getReg(44); |
254 |
|
} |
255 |
|
|
256 |
|
#define BSWAP(a) ((unsigned int) (_m64_mux1(a, 0xb) >> 32)) |
257 |
|
*/ |
258 |
|
|
259 |
|
#else |
260 |
|
|
261 |
// needed for bitstream.h |
// needed for bitstream.h |
262 |
#define BSWAP(a) \ |
#define BSWAP(a) \ |
263 |
((a) = ( ((a)&0xff)<<24) | (((a)&0xff00)<<8) | (((a)>>8)&0xff00) | (((a)>>24)&0xff)) |
((a) = ( ((a)&0xff)<<24) | (((a)&0xff00)<<8) | (((a)>>8)&0xff00) | (((a)>>24)&0xff)) |
264 |
|
|
265 |
// rdtsc command most likely not supported, |
// rdtsc command most likely not supported, |
266 |
// so just dummy code here |
// so just dummy code here |
267 |
static __inline int64_t read_counter() { |
static __inline int64_t |
268 |
|
read_counter() |
269 |
|
{ |
270 |
return 0; |
return 0; |
271 |
} |
} |
272 |
|
|
273 |
|
#endif // gcc or ecc |
274 |
|
|
275 |
#else |
#else |
276 |
#define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ) |
#define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ) |
277 |
#define EMMS() __asm__("emms\n\t") |
#define EMMS() __asm__("emms\n\t") |
300 |
|
|
301 |
#else // OTHER OS |
#else // OTHER OS |
302 |
|
|
303 |
|
#define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \ |
304 |
|
__declspec(align(alignment)) type name[(sizex)*(sizey)] |
305 |
|
|
306 |
#include <stdio.h> |
#include <stdio.h> |
307 |
#include <stdarg.h> |
#include <stdarg.h> |