summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKWSys Upstream <kwrobot@kitware.com>2020-04-21 11:05:16 (GMT)
committerBrad King <brad.king@kitware.com>2020-04-21 11:15:21 (GMT)
commite833e660efe92f6249ac87c09c7263cf2d3d43b3 (patch)
tree167539a98c75cd57d2fa71ad0fa07fe7d77cc217
parent363ec4f585b42c95824a3cec82702c9741623307 (diff)
downloadCMake-e833e660efe92f6249ac87c09c7263cf2d3d43b3.zip
CMake-e833e660efe92f6249ac87c09c7263cf2d3d43b3.tar.gz
CMake-e833e660efe92f6249ac87c09c7263cf2d3d43b3.tar.bz2
KWSys 2020-04-21 (44086372)
Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 4408637212fe1ddf09425beba97e105009734e31 (master). Upstream Shortlog ----------------- Hernan Martinez (1): 00629420 SystemInformation: Add support for Windows on ARM64
-rw-r--r--SystemInformation.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 95b06e1..ba9fa67 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -204,7 +204,8 @@ typedef struct rlimit ResourceLimitType;
# define USE_ASM_INSTRUCTIONS 0
#endif
-#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__clang__)
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__clang__) && \
+ !defined(_M_ARM64)
# include <intrin.h>
# define USE_CPUID_INTRINSICS 1
#else
@@ -4322,9 +4323,15 @@ SystemInformationImplementation::GetCyclesDifference(DELAY_FUNC DelayFunction,
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
unsigned __int64 stamp1, stamp2;
+# ifdef _M_ARM64
+ stamp1 = _ReadStatusReg(ARM64_PMCCNTR_EL0);
+ DelayFunction(uiParameter);
+ stamp2 = _ReadStatusReg(ARM64_PMCCNTR_EL0);
+# else
stamp1 = __rdtsc();
DelayFunction(uiParameter);
stamp2 = __rdtsc();
+# endif
return stamp2 - stamp1;
#elif USE_ASM_INSTRUCTIONS