# HG changeset patch # User aurel # Date 1113823460 0 # Node ID 1c1b53f353ffc363405621c60973a2bb2c896f48 # Parent 210cca8f57646785b79ccffcfe7328e079df2b60 add an AMD64 specific implementation of rdtsc() diff -r 210cca8f5764 -r 1c1b53f353ff common.h --- a/common.h Sun Apr 17 21:41:16 2005 +0000 +++ b/common.h Mon Apr 18 11:24:20 2005 +0000 @@ -457,6 +457,16 @@ #endif #if defined(ARCH_X86) || defined(ARCH_X86_64) +#if defined(ARCH_X86_64) +static inline uint64_t rdtsc(void) +{ + uint64_t a, d; + asm volatile( "rdtsc\n\t" + : "=a" (a), "=d" (d) + ); + return (d << 32) | (a & 0xffffffff); +} +#else static inline long long rdtsc(void) { long long l; @@ -465,6 +475,7 @@ ); return l; } +#endif #define START_TIMER \ uint64_t tend;\