[PATCH] D95940: - fix "#error You need to define CycleTimer for your OS and CPU" for e2k
Konstantin Ivlev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 3 04:53:34 PST 2021
SSE4 created this revision.
Herald added a reviewer: lebedev.ri.
Herald added a subscriber: lebedev.ri.
SSE4 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D95940
Files:
llvm/utils/benchmark/src/cycleclock.h
Index: llvm/utils/benchmark/src/cycleclock.h
===================================================================
--- llvm/utils/benchmark/src/cycleclock.h
+++ llvm/utils/benchmark/src/cycleclock.h
@@ -193,6 +193,10 @@
asm volatile("rdcycle %0" : "=r"(cycles));
return cycles;
#endif
+#elif defined(__e2k__) || defined(__elbrus__)
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
#else
// The soft failover to a generic implementation is automatic only for ARM.
// For other platforms the developer is expected to make an attempt to create
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95940.321060.patch
Type: text/x-patch
Size: 619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210203/b7507c01/attachment.bin>
More information about the llvm-commits
mailing list