diff options
author | José Fonseca <[email protected]> | 2009-10-22 19:02:42 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-10-22 19:12:14 +0100 |
commit | ba8c11923a13bdec53128988ffc26ceb5c4f7310 (patch) | |
tree | 5ad84a46e958dd90e4cfadc15492dd4f276d0772 /src/gallium/drivers/llvmpipe/lp_test.h | |
parent | 9aafa1fbd247cd6d1bb0ab47bc5b318bd0d67bc5 (diff) |
llvmpipe: Define rdtsc for MSVC.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_test.h')
-rw-r--r-- | 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 21016fefe3f..39d80726e65 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 |