Skip to content

Commit

Permalink
- and now it builds! but ... does it run?
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle committed Dec 7, 2020
1 parent 67096c8 commit bbfb934
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/common/engine/stats.h
Expand Up @@ -97,11 +97,13 @@ class cycle_t
#else

// Windows and macOS
#ifndef _M_ARM
#include "x86.h"
#endif

extern double PerfToSec, PerfToMillisec;

#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(_M_ARM64)
// Trying to include intrin.h here results in some bizarre errors, so I'm just
// going to duplicate the function prototype instead.
//#include <intrin.h>
Expand All @@ -111,6 +113,12 @@ inline unsigned __int64 rdtsc()
{
return __rdtsc();
}
#elif defined(_MSC_VER) && defined(_M_ARM64)
#include <intrin.h>
inline unsigned __int64 rdtsc()
{
return _ReadStatusReg(ARM64_SYSREG(3, 3, 13, 0, 2)); //_ReadStatusReg(PMCCNTR_EL0);
}
#elif defined __APPLE__ && (defined __i386__ || defined __x86_64__)
inline uint64_t rdtsc()
{
Expand Down

0 comments on commit bbfb934

Please sign in to comment.