diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 7071d7bf..d2f64356 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -41,6 +41,7 @@ Eric Backus Eric Fiselier Eugene Zhuk Evgeny Safronov +Fanbo Meng Federico Ficarelli Felix Homann Geoffrey Martin-Noble diff --git a/src/cycleclock.h b/src/cycleclock.h index 93d579a7..77be7b92 100644 --- a/src/cycleclock.h +++ b/src/cycleclock.h @@ -170,7 +170,12 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { #elif defined(__s390__) // Covers both s390 and s390x. // Return the CPU clock. uint64_t tsc; +#if defined(BENCHMARK_OS_ZOS) && defined(COMPILER_IBMXL) + // z/OS XL compiler HLASM syntax. + asm(" stck %0" : "=m"(tsc) : : "cc"); +#else asm("stck %0" : "=Q"(tsc) : : "cc"); +#endif return tsc; #elif defined(__riscv) // RISC-V // Use RDCYCLE (and RDCYCLEH on riscv32) diff --git a/src/internal_macros.h b/src/internal_macros.h index 889b3537..91f367b8 100644 --- a/src/internal_macros.h +++ b/src/internal_macros.h @@ -13,7 +13,11 @@ #endif #if defined(__clang__) - #if !defined(COMPILER_CLANG) + #if defined(__ibmxl__) + #if !defined(COMPILER_IBMXL) + #define COMPILER_IBMXL + #endif + #elif !defined(COMPILER_CLANG) #define COMPILER_CLANG #endif #elif defined(_MSC_VER) @@ -74,6 +78,8 @@ #define BENCHMARK_OS_SOLARIS 1 #elif defined(__QNX__) #define BENCHMARK_OS_QNX 1 +#elif defined(__MVS__) +#define BENCHMARK_OS_ZOS 1 #endif #if defined(__ANDROID__) && defined(__GLIBCXX__)