diff options
author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2018-06-19 13:22:55 +0000 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2018-06-19 13:22:55 +0000 |
commit | 3b6897aee923b20b8ea7788aa041497eaeee2bcb (patch) | |
tree | c44705a7e6d9a2d7a789ad4e55d6a7101808fc0b /MicroBenchmarks | |
parent | 057bae4cae6bec80306a4e1100dba9a6ba709622 (diff) |
[test-suite] Fix SystemZ build break (missing cycleclock::Now)
The s390 platform-specific implementation of cycleclock::Now in
libs/benchmark-1.3.0/src/cycleclock.h
was missing, causing a build break on SystemZ.
Fixed by backporting the upstream fix from here:
https://github.com/google/benchmark/pull/540
git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@335044 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'MicroBenchmarks')
-rw-r--r-- | MicroBenchmarks/libs/benchmark-1.3.0/src/cycleclock.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/MicroBenchmarks/libs/benchmark-1.3.0/src/cycleclock.h b/MicroBenchmarks/libs/benchmark-1.3.0/src/cycleclock.h index 4251fe4c..3b376ac5 100644 --- a/MicroBenchmarks/libs/benchmark-1.3.0/src/cycleclock.h +++ b/MicroBenchmarks/libs/benchmark-1.3.0/src/cycleclock.h @@ -159,6 +159,11 @@ 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(__s390__) // Covers both s390 and s390x. + // Return the CPU clock. + uint64_t tsc; + asm("stck %0" : "=Q" (tsc) : : "cc"); + return tsc; #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 |