[llvm] bd5fe7b - [M680x0] Add google/benchmark's CycleTimer support for M68K
Min-Yih Hsu via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 7 15:00:26 PDT 2020
Author: Min-Yih Hsu
Date: 2020-10-07T14:58:36-07:00
New Revision: bd5fe7b010ea0d6c4b1e5e3740085f5eabf7def6
URL: https://github.com/llvm/llvm-project/commit/bd5fe7b010ea0d6c4b1e5e3740085f5eabf7def6
DIFF: https://github.com/llvm/llvm-project/commit/bd5fe7b010ea0d6c4b1e5e3740085f5eabf7def6.diff
LOG: [M680x0] Add google/benchmark's CycleTimer support for M68K
This is a cherrypick of the upstream fix commit ffe1342 onto
`llvm/utils/benchmark` and `libcxx/utils/google-benchmark`.
This adds CycleTimer implementation for M680x0, which simply
uses `gettimeofday` same as MIPS.
Differential Review: https://reviews.llvm.org/D88868
Added:
Modified:
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
Removed:
################################################################################
diff --git a/libcxx/utils/google-benchmark/AUTHORS b/libcxx/utils/google-benchmark/AUTHORS
index 09e2e0551adf..3593870661ec 100644
--- a/libcxx/utils/google-benchmark/AUTHORS
+++ b/libcxx/utils/google-benchmark/AUTHORS
@@ -46,3 +46,4 @@ Stripe, Inc.
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>
diff --git a/libcxx/utils/google-benchmark/CONTRIBUTORS b/libcxx/utils/google-benchmark/CONTRIBUTORS
index ee74ff886c0c..9e7a39f25881 100644
--- a/libcxx/utils/google-benchmark/CONTRIBUTORS
+++ b/libcxx/utils/google-benchmark/CONTRIBUTORS
@@ -66,3 +66,4 @@ Tom Madams <tom.ej.madams at gmail.com> <tmadams at google.com>
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>
diff --git a/libcxx/utils/google-benchmark/README.LLVM b/libcxx/utils/google-benchmark/README.LLVM
index ea92eee202ce..7a0c02c420d4 100644
--- a/libcxx/utils/google-benchmark/README.LLVM
+++ b/libcxx/utils/google-benchmark/README.LLVM
@@ -22,3 +22,5 @@ Changes:
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
diff --git a/libcxx/utils/google-benchmark/src/cycleclock.h b/libcxx/utils/google-benchmark/src/cycleclock.h
index 179c67cd614a..93d579a739c1 100644
--- a/libcxx/utils/google-benchmark/src/cycleclock.h
+++ b/libcxx/utils/google-benchmark/src/cycleclock.h
@@ -161,7 +161,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
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;
diff --git a/llvm/utils/benchmark/AUTHORS b/llvm/utils/benchmark/AUTHORS
index 381a8f486afb..052a383f77cd 100644
--- a/llvm/utils/benchmark/AUTHORS
+++ b/llvm/utils/benchmark/AUTHORS
@@ -44,3 +44,4 @@ Stripe, Inc.
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>
diff --git a/llvm/utils/benchmark/CONTRIBUTORS b/llvm/utils/benchmark/CONTRIBUTORS
index 1cf04db17e4e..53e7b6f9f8b4 100644
--- a/llvm/utils/benchmark/CONTRIBUTORS
+++ b/llvm/utils/benchmark/CONTRIBUTORS
@@ -63,3 +63,4 @@ Tom Madams <tom.ej.madams at gmail.com> <tmadams at google.com>
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>
diff --git a/llvm/utils/benchmark/README.LLVM b/llvm/utils/benchmark/README.LLVM
index b370925b9543..afd70a3dd914 100644
--- a/llvm/utils/benchmark/README.LLVM
+++ b/llvm/utils/benchmark/README.LLVM
@@ -33,3 +33,5 @@ Changes:
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
diff --git a/llvm/utils/benchmark/src/cycleclock.h b/llvm/utils/benchmark/src/cycleclock.h
index 1b0f09359c9b..88b7805faafa 100644
--- a/llvm/utils/benchmark/src/cycleclock.h
+++ b/llvm/utils/benchmark/src/cycleclock.h
@@ -161,7 +161,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
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;
More information about the llvm-commits
mailing list