Unverified Commit ffe1342e by Min-Yih Hsu Committed by GitHub

Add CycleTimer implementation for M68K architecture (#1050)

As per discussions in here [1], LLVM is going to get backend support on Motorola 68000 series CPUs (a.k.a M68K or M680x0). So it's necessary to add CycleTimer implementation here, which is simply using `gettimeofday` same as MIPS. This fixes #1049 [1] https://reviews.llvm.org/D88389
parent 2d9bfe1e
...@@ -55,3 +55,4 @@ Stripe, Inc. ...@@ -55,3 +55,4 @@ Stripe, Inc.
Yixuan Qiu <yixuanq@gmail.com> Yixuan Qiu <yixuanq@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com> Yusuke Suzuki <utatane.tea@gmail.com>
Zbigniew Skowron <zbychs@gmail.com> Zbigniew Skowron <zbychs@gmail.com>
Min-Yih Hsu <yihshyng223@gmail.com>
...@@ -77,3 +77,4 @@ Tom Madams <tom.ej.madams@gmail.com> <tmadams@google.com> ...@@ -77,3 +77,4 @@ Tom Madams <tom.ej.madams@gmail.com> <tmadams@google.com>
Yixuan Qiu <yixuanq@gmail.com> Yixuan Qiu <yixuanq@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com> Yusuke Suzuki <utatane.tea@gmail.com>
Zbigniew Skowron <zbychs@gmail.com> Zbigniew Skowron <zbychs@gmail.com>
Min-Yih Hsu <yihshyng223@gmail.com>
...@@ -161,7 +161,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { ...@@ -161,7 +161,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
struct timeval tv; struct timeval tv;
gettimeofday(&tv, nullptr); gettimeofday(&tv, nullptr);
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec; 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 // mips apparently only allows rdtsc for superusers, so we fall
// back to gettimeofday. It's possible clock_gettime would be better. // back to gettimeofday. It's possible clock_gettime would be better.
struct timeval tv; struct timeval tv;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment