Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
ea5a5bbf
Unverified
Commit
ea5a5bbf
authored
Feb 12, 2021
by
Michał Janiszewski
Committed by
GitHub
Feb 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MSVC ARM64 support for reading clocks (#1052)
Lacks CMake support, see
https://github.com/google/benchmark/pull/1090
parent
8df87f6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
cycleclock.h
src/cycleclock.h
+7
-1
No files found.
src/cycleclock.h
View file @
ea5a5bbf
...
...
@@ -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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment