Update to 1.11.0-beta1
This commit is contained in:
15
src/cpu.cpp
15
src/cpu.cpp
@@ -16,11 +16,18 @@
|
||||
|
||||
/* rdtsc for MSC_VER, uses simple inline assembly, or _rdtsc
|
||||
* from external win64.asm because VS2005 does not support inline assembly */
|
||||
#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) && !defined(RDTSC_AVAILABLE)
|
||||
#if defined(_MSC_VER) && !defined(RDTSC_AVAILABLE)
|
||||
#include <intrin.h>
|
||||
#include <windows.h>
|
||||
uint64 ottd_rdtsc()
|
||||
{
|
||||
#if defined(_M_ARM)
|
||||
return __rdpmccntr64();
|
||||
#elif defined(_M_ARM64)
|
||||
return _ReadStatusReg(ARM64_PMCCNTR_EL0);
|
||||
#else
|
||||
return __rdtsc();
|
||||
#endif
|
||||
}
|
||||
#define RDTSC_AVAILABLE
|
||||
#endif
|
||||
@@ -66,6 +73,12 @@ uint64 ottd_rdtsc()
|
||||
# define RDTSC_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if defined(__EMSCRIPTEN__) && !defined(RDTSC_AVAILABLE)
|
||||
/* On emscripten doing TIC/TOC would be ill-advised */
|
||||
uint64 ottd_rdtsc() {return 0;}
|
||||
# define RDTSC_AVAILABLE
|
||||
#endif
|
||||
|
||||
/* In all other cases we have no support for rdtsc. No major issue,
|
||||
* you just won't be able to profile your code with TIC()/TOC() */
|
||||
#if !defined(RDTSC_AVAILABLE)
|
||||
|
||||
Reference in New Issue
Block a user