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: Nicolas Capens <nicolascapens@google.com>
Tested-by: Jeff Muizelaar <jmuizelaar@mozilla.com>
diff --git a/src/Common/Timer.cpp b/src/Common/Timer.cpp
index db0ba4a..0fa339f 100644
--- a/src/Common/Timer.cpp
+++ b/src/Common/Timer.cpp
@@ -65,9 +65,7 @@
return __rdtsc();
#endif
#elif defined(__i386__) || defined(__x86_64__)
- int64_t tsc;
- __asm volatile("rdtsc": "=A" (tsc));
- return tsc;
+ return __builtin_ia32_rdtsc();
#else
return 0;
#endif