17 #if ABSL_USE_UNSCALED_CYCLECLOCK 23 #if defined(__powerpc__) || defined(__ppc__) 24 #include <sys/platform/ppc.h> 30 namespace base_internal {
36 __asm__
volatile(
"rdtsc" :
"=A"(ret));
40 double UnscaledCycleClock::Frequency() {
44 #elif defined(__x86_64__) 48 __asm__
volatile(
"rdtsc" :
"=a"(low),
"=d"(high));
49 return (high << 32) | low;
52 double UnscaledCycleClock::Frequency() {
56 #elif defined(__powerpc__) || defined(__ppc__) 59 return __ppc_get_timebase();
62 double UnscaledCycleClock::Frequency() {
63 return __ppc_get_timebase_freq();
66 #elif defined(__aarch64__) 73 int64_t virtual_timer_value;
74 asm volatile(
"mrs %0, cntvct_el0" :
"=r"(virtual_timer_value));
75 return virtual_timer_value;
78 double UnscaledCycleClock::Frequency() {
79 uint64_t aarch64_timer_frequency;
80 asm volatile(
"mrs %0, cntfrq_el0" :
"=r"(aarch64_timer_frequency));
81 return aarch64_timer_frequency;
84 #elif defined(_M_IX86) || defined(_M_X64) 86 #pragma intrinsic(__rdtsc) 92 double UnscaledCycleClock::Frequency() {
101 #endif // ABSL_USE_UNSCALED_CYCLECLOCK
double NominalCPUFrequency()