31#if !defined(__i386__) && !defined(__x86_64__) && !defined(__sparc__)
32#warning No supported architecture found -- timers will return junk.
35static __inline__ uint64_t curtick() {
39 __asm__ __volatile__ (
".byte 0x0f, 0x31" :
"=a" (lo),
"=d" (hi));
40 tick = (uint64_t) hi << 32 | lo;
41#elif defined(__x86_64__)
43 __asm__ __volatile__ (
"rdtsc" :
"=a" (lo),
"=d" (hi));
44 tick = (uint64_t) hi << 32 | lo;
45#elif defined(__sparc__)
46 __asm__ __volatile__ (
"rd %%tick, %0" :
"=r" (tick));
51static __inline__
void startTimer(uint64_t* t) {
55static __inline__
void stopTimer(uint64_t* t) {