Mesa (master): llvmpipe: Define rdtsc for MSVC.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Thu Oct 22 18:12:29 UTC 2009


Module: Mesa
Branch: master
Commit: ba8c11923a13bdec53128988ffc26ceb5c4f7310
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba8c11923a13bdec53128988ffc26ceb5c4f7310

Author: José Fonseca <jfonseca at vmware.com>
Date:   Thu Oct 22 19:02:42 2009 +0100

llvmpipe: Define rdtsc for MSVC.

---

 src/gallium/drivers/llvmpipe/lp_test.h |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_test.h b/src/gallium/drivers/llvmpipe/lp_test.h
index 21016fe..39d8072 100644
--- a/src/gallium/drivers/llvmpipe/lp_test.h
+++ b/src/gallium/drivers/llvmpipe/lp_test.h
@@ -71,17 +71,28 @@ boolean
 test_all(unsigned verbose, FILE *fp);
 
 
+#if defined(PIPE_CC_MSVC)
+
+unsigned __int64 __rdtsc();
+#pragma intrinsic(__rdtsc)
+#define rdtsc() __rdtsc()
+
+#elif defined(PIPE_CC_GCC) && (defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64))
+
 static INLINE uint64_t
 rdtsc(void)
 {
-#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
    uint32_t hi, lo;
    __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
    return ((uint64_t)lo) | (((uint64_t)hi) << 32);
+}
+
 #else
-   return 0;
+
+#define rdtsc() 0
+
 #endif
-}
+
 
 
 float




More information about the mesa-commit mailing list