52 |
* exception also makes it possible to release a modified version which |
* exception also makes it possible to release a modified version which |
53 |
* carries forward this exception. |
* carries forward this exception. |
54 |
* |
* |
55 |
* $Id: portab.h,v 1.26.2.4 2003-01-04 06:14:32 suxen_drol Exp $ |
* $Id: portab.h,v 1.26.2.6 2003-01-11 14:59:23 chl Exp $ |
56 |
* |
* |
57 |
****************************************************************************/ |
****************************************************************************/ |
58 |
|
|
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 |
198 |
*---------------------------------------------------------------------------*/ |
*---------------------------------------------------------------------------*/ |
199 |
# if defined(ARCH_X86) |
# if defined(ARCH_X86) |
200 |
# 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} |
|
201 |
|
|
202 |
static __inline int64_t read_counter(void) |
static __inline int64_t read_counter(void) |
203 |
{ |
{ |
223 |
(((x) & 0x0000ff00) << 8) | \ |
(((x) & 0x0000ff00) << 8) | \ |
224 |
(((x) & 0x000000ff) << 24)) |
(((x) & 0x000000ff) << 24)) |
225 |
|
|
|
#define EMMS() |
|
|
#define FEMMS() |
|
226 |
# endif |
# endif |
227 |
|
|
228 |
|
|
268 |
*---------------------------------------------------------------------------*/ |
*---------------------------------------------------------------------------*/ |
269 |
# if defined(ARCH_X86) |
# if defined(ARCH_X86) |
270 |
# 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"); |
|
271 |
|
|
272 |
static __inline int64_t read_counter(void) |
static __inline int64_t read_counter(void) |
273 |
{ |
{ |
284 |
# elif defined(ARCH_PPC) |
# elif defined(ARCH_PPC) |
285 |
# define BSWAP(a) __asm__ __volatile__ \ |
# define BSWAP(a) __asm__ __volatile__ \ |
286 |
( "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() |
|
287 |
|
|
288 |
static __inline unsigned long get_tbl(void) |
static __inline unsigned long get_tbl(void) |
289 |
{ |
{ |
316 |
# define BSWAP(a) __asm__ __volatile__ \ |
# define BSWAP(a) __asm__ __volatile__ \ |
317 |
("mux1 %1 = %0, @rev" ";;" \ |
("mux1 %1 = %0, @rev" ";;" \ |
318 |
"shr.u %1 = %1, 32" : "=r" (a) : "r" (a)); |
"shr.u %1 = %1, 32" : "=r" (a) : "r" (a)); |
|
# define EMMS() |
|
|
# define FEMMS() |
|
319 |
|
|
320 |
static __inline int64_t read_counter(void) { |
static __inline int64_t read_counter(void) { |
321 |
unsigned long result; |
unsigned long result; |
330 |
# define BSWAP(a) \ |
# define BSWAP(a) \ |
331 |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ |
332 |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
|
# define EMMS() |
|
|
# define FEMMS() |
|
333 |
|
|
334 |
static __inline int64_t read_counter(void) |
static __inline int64_t read_counter(void) |
335 |
{ |
{ |
343 |
# define BSWAP(a) \ |
# define BSWAP(a) \ |
344 |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ |
345 |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
|
# define EMMS() |
|
|
# define FEMMS() |
|
346 |
|
|
347 |
static __inline int64_t read_counter(void) |
static __inline int64_t read_counter(void) |
348 |
{ |
{ |
360 |
(((x) & 0x0000ff00) << 8) | \ |
(((x) & 0x0000ff00) << 8) | \ |
361 |
(((x) & 0x000000ff) << 24)) |
(((x) & 0x000000ff) << 24)) |
362 |
|
|
|
#define EMMS() |
|
|
#define FEMMS() |
|
363 |
# endif /* Architecture checking */ |
# endif /* Architecture checking */ |
364 |
|
|
365 |
/***************************************************************************** |
/***************************************************************************** |