Where does GCC document how to use the builtin rdtsc and rdtscp functions? Looking at ia32intrin.h, I can see it defined as: /* rdtsc */ #define __rdtsc() __builtin_ia32_rdtsc () ... /* rdtscp */ #define __rdtscp(a) __builtin_ia32_rdtscp (a) But the top of that file states: #ifndef _X86GPRINTRIN_H_INCLUDED # error "Never use <ia32intrin.h> directly; include <x86gprintrin.h> instead." #endif Namely, I'm interesting in knowing: 1) What the return type of the two functions are 2) What the 'a' arg is to the second 3) If using these includes serializing calls to lfence or similar