Commit adb0d51c by Tom Tan Committed by Nicolas Capens

Fix intrinsic of getting timer tick for Windows ARM64

src/System/Timer.cpp which was duplicated for Vulkan uses x86 intrinsic __rdtsc to tick count. This intrinsic is not available on ARM and needs to be fixed. This issue broke Windows ARM64 build bot and the same issue was fixed for src/Common/Timer.cpp before (see below links). https://ci.chromium.org/p/chromium/builders/ci/win32-arm64-rel/7763 https://swiftshader-review.googlesource.com/c/SwiftShader/+/23508 Bug: chromium:893460 Change-Id: I48e3673034650a89fead71447d75f4e486ee68b5 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36308 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent c9fa9fe9
...@@ -59,7 +59,11 @@ namespace sw ...@@ -59,7 +59,11 @@ namespace sw
int64_t Timer::ticks() int64_t Timer::ticks()
{ {
#if defined(_WIN32) #if defined(_WIN32)
return __rdtsc(); #if defined(_M_ARM64)
return _ReadStatusReg(ARM64_PMCCNTR_EL0);
#else
return __rdtsc();
#endif
#elif defined(__i386__) || defined(__x86_64__) #elif defined(__i386__) || defined(__x86_64__)
int64_t tsc; int64_t tsc;
__asm volatile("rdtsc": "=A" (tsc)); __asm volatile("rdtsc": "=A" (tsc));
......
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