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
ef1ccf4d
Commit
ef1ccf4d
authored
Mar 20, 2014
by
Dominic Hamon
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12 from showlabor/master
Fix cycleclock.h for gcc/ARM.
parents
f835dfa8
44b64c93
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
AUTHORS
AUTHORS
+1
-0
CONTRIBUTORS
CONTRIBUTORS
+1
-0
cycleclock.h
src/cycleclock.h
+3
-3
No files found.
AUTHORS
View file @
ef1ccf4d
...
@@ -12,6 +12,7 @@ Christopher Seymour <chris.j.seymour@hotmail.com>
...
@@ -12,6 +12,7 @@ Christopher Seymour <chris.j.seymour@hotmail.com>
David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
Dominic Hamon <dma@stripysock.com>
Dominic Hamon <dma@stripysock.com>
Eugene Zhuk <eugene.zhuk@gmail.com>
Eugene Zhuk <eugene.zhuk@gmail.com>
Felix Homann <linuxaudio@showlabor.de>
Google Inc.
Google Inc.
Oleksandr Sochka <sasha.sochka@gmail.com>
Oleksandr Sochka <sasha.sochka@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com>
CONTRIBUTORS
View file @
ef1ccf4d
...
@@ -26,6 +26,7 @@ Christopher Seymour <chris.j.seymour@hotmail.com>
...
@@ -26,6 +26,7 @@ Christopher Seymour <chris.j.seymour@hotmail.com>
David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
Dominic Hamon <dma@stripysock.com>
Dominic Hamon <dma@stripysock.com>
Eugene Zhuk <eugene.zhuk@gmail.com>
Eugene Zhuk <eugene.zhuk@gmail.com>
Felix Homann <linuxaudio@showlabor.de>
Oleksandr Sochka <sasha.sochka@gmail.com>
Oleksandr Sochka <sasha.sochka@gmail.com>
Pierre Phaneuf <pphaneuf@google.com>
Pierre Phaneuf <pphaneuf@google.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com>
src/cycleclock.h
View file @
ef1ccf4d
...
@@ -95,8 +95,8 @@ inline ATTRIBUTE_ALWAYS_INLINE int64_t Now() {
...
@@ -95,8 +95,8 @@ inline ATTRIBUTE_ALWAYS_INLINE int64_t Now() {
_asm
rdtsc
_asm
rdtsc
#elif defined(COMPILER_MSVC)
#elif defined(COMPILER_MSVC)
return
__rdtsc
();
return
__rdtsc
();
#elif defined(
ARMV3
)
#elif defined(
__ARM_ARCH
)
#if
defined(ARMV
6) // V6 is the earliest arch that has a standard cyclecount
#if
(__ARM_ARCH >=
6) // V6 is the earliest arch that has a standard cyclecount
uint32_t
pmccntr
;
uint32_t
pmccntr
;
uint32_t
pmuseren
;
uint32_t
pmuseren
;
uint32_t
pmcntenset
;
uint32_t
pmcntenset
;
...
@@ -107,7 +107,7 @@ inline ATTRIBUTE_ALWAYS_INLINE int64_t Now() {
...
@@ -107,7 +107,7 @@ inline ATTRIBUTE_ALWAYS_INLINE int64_t Now() {
if
(
pmcntenset
&
0x80000000ul
)
{
// Is it counting?
if
(
pmcntenset
&
0x80000000ul
)
{
// Is it counting?
asm
(
"mrc p15, 0, %0, c9, c13, 0"
:
"=r"
(
pmccntr
));
asm
(
"mrc p15, 0, %0, c9, c13, 0"
:
"=r"
(
pmccntr
));
// The counter is set up to count every 64th cycle
// The counter is set up to count every 64th cycle
return
static_cast
<
int64
>
(
pmccntr
)
*
64
;
// Should optimize to << 6
return
static_cast
<
int64
_t
>
(
pmccntr
)
*
64
;
// Should optimize to << 6
}
}
}
}
#endif
#endif
...
...
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