'What is the gcc cpu-type that includes support for RDTSCP?
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?
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
