Commit 221a2746 by Jeff Muizelaar Committed by Jeff Muizelaar

Fix Timer::ticks() on x86-64.

Using =A is not the right constraint for x86-64. rdtsc is actually used as an example in the gcc documentation and for x86-64 something like "=a"(tickl),"=d"(tickh) should be used. Instead of worrying about this we can just use the builtin. Change-Id: Ied720de0861ff9231a4a4cdf85b75945fe478056 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/34108 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarJeff Muizelaar <jmuizelaar@mozilla.com>
parent 4cd9767e
...@@ -65,9 +65,7 @@ namespace sw ...@@ -65,9 +65,7 @@ namespace sw
return __rdtsc(); return __rdtsc();
#endif #endif
#elif defined(__i386__) || defined(__x86_64__) #elif defined(__i386__) || defined(__x86_64__)
int64_t tsc; return __builtin_ia32_rdtsc();
__asm volatile("rdtsc": "=A" (tsc));
return tsc;
#else #else
return 0; return 0;
#endif #endif
......
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