Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void get_cycles(unsigned *high,unsigned *low)
- {
- asm volatile ("CPUID\n\t"
- "RDTSC\n\t"
- "mov %%edx, %0\n\t"
- "movl %%eax, %1\n\t": "=r" (*high), "=r" (*low)::"%rax","%rbx","%rcx","%rdx"
- );
- }
- static inline __attribute__((always_inline))
- void get_cycles_end(unsigned *high,unsigned *low){
- asm volatile("RDTSCP\n\t"
- "mov %%edx, %0\n\t"
- "mov %%eax, %1\n\t"
- "CPUID\n\t": "=r" (*high), "=r" (*low)::"%rax","%rbx","%rcx","%rdx"
- );
- }
Add Comment
Please, Sign In to add comment