Skip to content

Commit 114e498

Browse files
committed
Fix build when targetting Arm64EC using Clang
1 parent 4e18a00 commit 114e498

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/cycleclock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
7979
int64_t ret;
8080
__asm__ volatile("rdtsc" : "=A"(ret));
8181
return ret;
82-
#elif defined(__x86_64__) || defined(__amd64__)
82+
#elif (defined(__x86_64__) || defined(__amd64__)) && !defined(__arm64ec__)
8383
uint64_t low, high;
8484
__asm__ volatile("rdtsc" : "=a"(low), "=d"(high));
8585
return static_cast<int64_t>((high << 32) | low);
@@ -139,7 +139,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
139139
struct timespec ts = {0, 0};
140140
clock_gettime(CLOCK_MONOTONIC, &ts);
141141
return static_cast<int64_t>(ts.tv_sec) * 1000000000 + ts.tv_nsec;
142-
#elif defined(__aarch64__)
142+
#elif defined(__aarch64__) || defined(__arm64ec__)
143143
// System timer of ARMv8 runs at a different frequency than the CPU's.
144144
// The frequency is fixed, typically in the range 1-50MHz. It can be
145145
// read at CNTFRQ special register. We assume the OS has set up

0 commit comments

Comments
 (0)