76 |
|
|
77 |
/* debug level for this library */ |
/* debug level for this library */ |
78 |
#ifdef _DEBUG |
#ifdef _DEBUG |
79 |
#define DPRINTF_LEVEL (DPRINTF_RC|0x0000000f) |
#define DPRINTF_LEVEL (DPRINTF_RC|0x0000007F) |
80 |
#else |
#else |
81 |
#define DPRINTF_LEVEL DPRINTF_RC |
#define DPRINTF_LEVEL DPRINTF_RC |
82 |
#endif |
#endif |
167 |
#include <windows.h> |
#include <windows.h> |
168 |
#include <stdio.h> |
#include <stdio.h> |
169 |
|
|
170 |
|
/* non-ansi function mapping */ |
171 |
|
# define snprintf _snprintf |
172 |
|
# define vsnprintf _vsnprintf |
173 |
|
|
174 |
/* |
/* |
175 |
* This function must be declared/defined all the time because MSVC does |
* This function must be declared/defined all the time because MSVC does |
176 |
* not support C99 variable arguments macros |
* not support C99 variable arguments macros |
202 |
*---------------------------------------------------------------------------*/ |
*---------------------------------------------------------------------------*/ |
203 |
# if defined(ARCH_X86) |
# if defined(ARCH_X86) |
204 |
# 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 |
|
# define EMMS() __asm {emms} |
|
|
# define FEMMS() __asm {femms} |
|
205 |
|
|
206 |
static __inline int64_t read_counter(void) |
static __inline int64_t read_counter(void) |
207 |
{ |
{ |
227 |
(((x) & 0x0000ff00) << 8) | \ |
(((x) & 0x0000ff00) << 8) | \ |
228 |
(((x) & 0x000000ff) << 24)) |
(((x) & 0x000000ff) << 24)) |
229 |
|
|
|
#define EMMS() |
|
|
#define FEMMS() |
|
230 |
# endif |
# endif |
231 |
|
|
232 |
|
|
272 |
*---------------------------------------------------------------------------*/ |
*---------------------------------------------------------------------------*/ |
273 |
# if defined(ARCH_X86) |
# if defined(ARCH_X86) |
274 |
# define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ); |
# define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) ); |
|
# define EMMS() __asm__ ("emms\n\t"); |
|
|
# define FEMMS() __asm__ ("femms\n\t"); |
|
275 |
|
|
276 |
static __inline int64_t read_counter(void) |
static __inline int64_t read_counter(void) |
277 |
{ |
{ |
288 |
# elif defined(ARCH_PPC) |
# elif defined(ARCH_PPC) |
289 |
# define BSWAP(a) __asm__ __volatile__ \ |
# define BSWAP(a) __asm__ __volatile__ \ |
290 |
( "lwbrx %0,0,%1; eieio" : "=r" (a) : "r" (&(a)), "m" (a)); |
( "lwbrx %0,0,%1; eieio" : "=r" (a) : "r" (&(a)), "m" (a)); |
|
# define EMMS() |
|
|
# define FEMMS() |
|
291 |
|
|
292 |
static __inline unsigned long get_tbl(void) |
static __inline unsigned long get_tbl(void) |
293 |
{ |
{ |
320 |
# define BSWAP(a) __asm__ __volatile__ \ |
# define BSWAP(a) __asm__ __volatile__ \ |
321 |
("mux1 %1 = %0, @rev" ";;" \ |
("mux1 %1 = %0, @rev" ";;" \ |
322 |
"shr.u %1 = %1, 32" : "=r" (a) : "r" (a)); |
"shr.u %1 = %1, 32" : "=r" (a) : "r" (a)); |
|
# define EMMS() |
|
|
# define FEMMS() |
|
323 |
|
|
324 |
static __inline int64_t read_counter(void) { |
static __inline int64_t read_counter(void) { |
325 |
unsigned long result; |
unsigned long result; |
334 |
# define BSWAP(a) \ |
# define BSWAP(a) \ |
335 |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ |
336 |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
|
# define EMMS() |
|
|
# define FEMMS() |
|
337 |
|
|
338 |
static __inline int64_t read_counter(void) |
static __inline int64_t read_counter(void) |
339 |
{ |
{ |
347 |
# define BSWAP(a) \ |
# define BSWAP(a) \ |
348 |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ |
349 |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
|
# define EMMS() |
|
|
# define FEMMS() |
|
350 |
|
|
351 |
static __inline int64_t read_counter(void) |
static __inline int64_t read_counter(void) |
352 |
{ |
{ |
364 |
(((x) & 0x0000ff00) << 8) | \ |
(((x) & 0x0000ff00) << 8) | \ |
365 |
(((x) & 0x000000ff) << 24)) |
(((x) & 0x000000ff) << 24)) |
366 |
|
|
|
#define EMMS() |
|
|
#define FEMMS() |
|
367 |
# endif /* Architecture checking */ |
# endif /* Architecture checking */ |
368 |
|
|
369 |
/***************************************************************************** |
/***************************************************************************** |