diff options
author | 2016-03-12 12:31:13 +0100 | |
---|---|---|
committer | 2016-03-12 12:31:13 +0100 | |
commit | a026a582f1a0ea8c1ede3acaddacef506ef3f3b0 (patch) | |
tree | e31573822f2359677de519f9f3b600d98e8764cd /3rdparty/benchmark/src/cycleclock.h | |
parent | 477d2abd43984f076b7e45f5527591fa8fd0d241 (diff) | |
parent | dcab55bf53b94713a6f72e9633f5101c8dd6c08c (diff) |
Merge pull request #15 from mamedev/master
Sync to base master
Diffstat (limited to '3rdparty/benchmark/src/cycleclock.h')
-rw-r--r-- | 3rdparty/benchmark/src/cycleclock.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/3rdparty/benchmark/src/cycleclock.h b/3rdparty/benchmark/src/cycleclock.h index 42541dafc88..3110804634c 100644 --- a/3rdparty/benchmark/src/cycleclock.h +++ b/3rdparty/benchmark/src/cycleclock.h @@ -99,6 +99,14 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { _asm rdtsc #elif defined(COMPILER_MSVC) return __rdtsc(); +#elif defined(__aarch64__) + // System timer of ARMv8 runs at a different frequency than the CPU's. + // The frequency is fixed, typically in the range 1-50MHz. It can be + // read at CNTFRQ special register. We assume the OS has set up + // the virtual timer properly. + int64_t virtual_timer_value; + asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); + return virtual_timer_value; #elif defined(__ARM_ARCH) #if (__ARM_ARCH >= 6) // V6 is the earliest arch that has a standard cyclecount uint32_t pmccntr; |