[PATCH] D88868: [M680x0] Add CycleTimer implementation for M68K architecture

Min-Yih Hsu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 20:32:08 PDT 2020


myhsu created this revision.
myhsu added reviewers: lebedev.ri, libc++.
Herald added subscribers: llvm-commits, libcxx-commits, atanasyan, arichardson, sdardis.
Herald added projects: libc++, LLVM.
Herald added 1 blocking reviewer(s): libc++.
myhsu requested review of this revision.

This is a cherrypick of the upstream fix commit ffe1342 onto
`llvm/utils/benchmakr` and `libcxx/utils/google-benchmark`.
This adds CycleTimer implementation for M680x0, and simply
uses `gettimeofday` to implement, same as MIPS.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88868

Files:
  libcxx/utils/google-benchmark/AUTHORS
  libcxx/utils/google-benchmark/CONTRIBUTORS
  libcxx/utils/google-benchmark/README.LLVM
  libcxx/utils/google-benchmark/src/cycleclock.h
  llvm/utils/benchmark/AUTHORS
  llvm/utils/benchmark/CONTRIBUTORS
  llvm/utils/benchmark/README.LLVM
  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
@@ -161,7 +161,7 @@
   struct timeval tv;
   gettimeofday(&tv, nullptr);
   return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
-#elif defined(__mips__)
+#elif defined(__mips__) || defined(__m68k__)
   // mips apparently only allows rdtsc for superusers, so we fall
   // back to gettimeofday.  It's possible clock_gettime would be better.
   struct timeval tv;
Index: llvm/utils/benchmark/README.LLVM
===================================================================
--- llvm/utils/benchmark/README.LLVM
+++ llvm/utils/benchmark/README.LLVM
@@ -33,3 +33,5 @@
   are applied on top of the previous cherrypick to fix timestamp-related inline
   asm issues and 32-bit RISC-V build failures. The second cherrypicked commit
   fixes formatting issues introduced by the preceding change.
+* https://github.com/google/benchmark/commit/ffe1342eb2faa7d2e7c35b4db2ccf99fab81ec20
+  is applied to add the CycleTimer implementation for M680x0
Index: llvm/utils/benchmark/CONTRIBUTORS
===================================================================
--- llvm/utils/benchmark/CONTRIBUTORS
+++ llvm/utils/benchmark/CONTRIBUTORS
@@ -63,3 +63,4 @@
 Yixuan Qiu <yixuanq at gmail.com>
 Yusuke Suzuki <utatane.tea at gmail.com>
 Zbigniew Skowron <zbychs at gmail.com>
+Min-Yih Hsu <yihshyng223 at gmail.com>
Index: llvm/utils/benchmark/AUTHORS
===================================================================
--- llvm/utils/benchmark/AUTHORS
+++ llvm/utils/benchmark/AUTHORS
@@ -44,3 +44,4 @@
 Yixuan Qiu <yixuanq at gmail.com>
 Yusuke Suzuki <utatane.tea at gmail.com>
 Zbigniew Skowron <zbychs at gmail.com>
+Min-Yih Hsu <yihshyng223 at gmail.com>
Index: libcxx/utils/google-benchmark/src/cycleclock.h
===================================================================
--- libcxx/utils/google-benchmark/src/cycleclock.h
+++ libcxx/utils/google-benchmark/src/cycleclock.h
@@ -161,7 +161,7 @@
   struct timeval tv;
   gettimeofday(&tv, nullptr);
   return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
-#elif defined(__mips__)
+#elif defined(__mips__) || defined(__m68k__)
   // mips apparently only allows rdtsc for superusers, so we fall
   // back to gettimeofday.  It's possible clock_gettime would be better.
   struct timeval tv;
Index: libcxx/utils/google-benchmark/README.LLVM
===================================================================
--- libcxx/utils/google-benchmark/README.LLVM
+++ libcxx/utils/google-benchmark/README.LLVM
@@ -22,3 +22,5 @@
   to fix timestamp-related inline asm issues and 32-bit RISC-V build failures.
   The second cherrypicked commit fixes formatting issues introduced by the
   preceding change.
+* https://github.com/google/benchmark/commit/ffe1342eb2faa7d2e7c35b4db2ccf99fab81ec20
+  is applied to add the CycleTimer implementation for M680x0
Index: libcxx/utils/google-benchmark/CONTRIBUTORS
===================================================================
--- libcxx/utils/google-benchmark/CONTRIBUTORS
+++ libcxx/utils/google-benchmark/CONTRIBUTORS
@@ -66,3 +66,4 @@
 Yixuan Qiu <yixuanq at gmail.com>
 Yusuke Suzuki <utatane.tea at gmail.com>
 Zbigniew Skowron <zbychs at gmail.com>
+Min-Yih Hsu <yihshyng223 at gmail.com>
Index: libcxx/utils/google-benchmark/AUTHORS
===================================================================
--- libcxx/utils/google-benchmark/AUTHORS
+++ libcxx/utils/google-benchmark/AUTHORS
@@ -46,3 +46,4 @@
 Yixuan Qiu <yixuanq at gmail.com>
 Yusuke Suzuki <utatane.tea at gmail.com>
 Zbigniew Skowron <zbychs at gmail.com>
+Min-Yih Hsu <yihshyng223 at gmail.com>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88868.296352.patch
Type: text/x-patch
Size: 3708 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201006/113fa2ba/attachment.bin>


More information about the llvm-commits mailing list