diff options
author | Haibo Huang <hhb@google.com> | 2021-02-17 07:11:28 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-02-17 07:11:28 +0000 |
commit | 87a2e38212e1df780151ccb14cb7828e719e8d33 (patch) | |
tree | 61f88d9a095a390cab484c109bd55ce293b117b0 | |
parent | fece3b35aab645f35f461652426db6290fca2675 (diff) | |
parent | e74f377d60b79172dae696253b66d1333397f00c (diff) | |
download | google-benchmark-87a2e38212e1df780151ccb14cb7828e719e8d33.tar.gz |
Upgrade google-benchmark to ea5a5bbff491fd625c6e3458f6edd680b8bd5452 am: 5d086d83c4 am: 8debd28366 am: 58f16097dc am: e74f377d60
Original change: https://android-review.googlesource.com/c/platform/external/google-benchmark/+/1587517
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Icda4397e39f9475444918da470d1b16fb23b1c5d
-rw-r--r-- | METADATA | 6 | ||||
-rw-r--r-- | src/cycleclock.h | 8 |
2 files changed, 10 insertions, 4 deletions
@@ -9,11 +9,11 @@ third_party { type: GIT value: "https://github.com/google/benchmark.git" } - version: "8df87f6c879cbcabd17c5cfcec7b89687df36953" + version: "ea5a5bbff491fd625c6e3458f6edd680b8bd5452" license_type: NOTICE last_upgrade_date { year: 2021 - month: 1 - day: 5 + month: 2 + day: 12 } } diff --git a/src/cycleclock.h b/src/cycleclock.h index 89de86f..6843b69 100644 --- a/src/cycleclock.h +++ b/src/cycleclock.h @@ -36,7 +36,7 @@ // declarations of some other intrinsics, breaking compilation. // Therefore, we simply declare __rdtsc ourselves. See also // http://connect.microsoft.com/VisualStudio/feedback/details/262047 -#if defined(COMPILER_MSVC) && !defined(_M_IX86) +#if defined(COMPILER_MSVC) && !defined(_M_IX86) && !defined(_M_ARM64) extern "C" uint64_t __rdtsc(); #pragma intrinsic(__rdtsc) #endif @@ -114,6 +114,12 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { // when I know it will work. Otherwise, I'll use __rdtsc and hope // the code is being compiled with a non-ancient compiler. _asm rdtsc +#elif defined(COMPILER_MSVC) && defined(_M_ARM64) + // See https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=vs-2019 + // and https://reviews.llvm.org/D53115 + int64_t virtual_timer_value; + virtual_timer_value = _ReadStatusReg(ARM64_CNTVCT); + return virtual_timer_value; #elif defined(COMPILER_MSVC) return __rdtsc(); #elif defined(BENCHMARK_OS_NACL) |