diff --git a/src/nvcore/CpuInfo.h b/src/nvcore/CpuInfo.h index 08a77ab..099cf61 100644 --- a/src/nvcore/CpuInfo.h +++ b/src/nvcore/CpuInfo.h @@ -6,8 +6,10 @@ #include #if NV_CC_MSVC +#if _MSC_VER >= 1400 # include // __rdtsc #endif +#endif namespace nv @@ -27,6 +29,16 @@ namespace nv }; #if NV_CC_MSVC +#if _MSC_VER < 1400 + inline uint64 rdtsc() + { + uint64 t; + __asm rdtsc + __asm mov DWORD PTR [t], eax + __asm mov DWORD PTR [t+4], edx + return t; + } +#else #pragma intrinsic(__rdtsc) inline uint64 rdtsc() @@ -34,6 +46,7 @@ namespace nv return __rdtsc(); } #endif +#endif #if NV_CC_GNUC