I am using RDTSCP to replace LFENCE;RDTSC sequences and also get the processor ID back so that I know when I'm comparing TSC values after the thread was rescheduled to another CPU.
To ensure I don't run RDTSCP on a too old machine I fallback to RDTSC after a CPUID check (using libcpuid). I'd like to try using the gcc multiple target attribute functionality instead of a CPUID call:
int core2_func (void) __attribute__ ((__target__ ("arch=core2")));
The gcc manual lists a number of cpu families (haswell, skylake, ...). How would I find which cpu family first introduced RDTSCP?
All AMD processors since the K8 Hammer support RDTSCP.
On Intel processors, RDTSCP is supported on Nehalem and later, Silvermont and later, and Knights Landing and later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With