masters-thesis/listings/rdtscp.h

18 lines
210 B
C
Raw Normal View History

static inline uint64_t rdtscp()
{
uint64_t tsc;
__asm__ __volatile__(
"rdtscp;"
"shl $32, %%rdx;"
"or %%rdx,%%rax"
: "=a" (tsc)
:
: "%rcx", "%rdx", "memory"
);
return tsc;
}