[test-suite] r335044 - [test-suite] Fix SystemZ build break (missing cycleclock::Now)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 19 06:22:55 PDT 2018


Author: uweigand
Date: Tue Jun 19 06:22:55 2018
New Revision: 335044

URL: http://llvm.org/viewvc/llvm-project?rev=335044&view=rev
Log:
[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


Modified:
    test-suite/trunk/MicroBenchmarks/libs/benchmark-1.3.0/src/cycleclock.h

Modified: test-suite/trunk/MicroBenchmarks/libs/benchmark-1.3.0/src/cycleclock.h
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/libs/benchmark-1.3.0/src/cycleclock.h?rev=335044&r1=335043&r2=335044&view=diff
==============================================================================
--- test-suite/trunk/MicroBenchmarks/libs/benchmark-1.3.0/src/cycleclock.h (original)
+++ test-suite/trunk/MicroBenchmarks/libs/benchmark-1.3.0/src/cycleclock.h Tue Jun 19 06:22:55 2018
@@ -159,6 +159,11 @@ inline BENCHMARK_ALWAYS_INLINE int64_t N
   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




More information about the llvm-commits mailing list