[PATCH] D95944: - 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 05:14:46 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/D95944

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: D95944.321066.patch
Type: text/x-patch
Size: 619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210203/acdd4be4/attachment.bin>


More information about the llvm-commits mailing list