Skip to content

Commit

Permalink
Merge pull request #2 from k15tfu/fix-build-aarch64
Browse files Browse the repository at this point in the history
Use cntvct_el0 to get time in utf_converters/performance test case on ARM64
  • Loading branch information
ww898 committed Apr 9, 2020
2 parents c310e45 + 5a3c0aa commit b26d0ca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/utf_converters_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,12 @@ uint64_t get_time() throw()
#endif
);
return static_cast<uint64_t>(hi) << 32 | lo;
#elif defined(__aarch64__)
uint64_t cntvct_el0;
asm volatile(
"mrs %0, cntvct_el0\n\t"
: "=r" (cntvct_el0) : : );
return cntvct_el0;
#else
#error Unsupported architecture
#endif
Expand Down

0 comments on commit b26d0ca

Please sign in to comment.