Update arch macros.
This commit is contained in:
+4
-5
@@ -1,4 +1,3 @@
|
|||||||
#include "base_context_cracking.h"
|
|
||||||
#include "base_core.h"
|
#include "base_core.h"
|
||||||
#include "sdl_handmade.h"
|
#include "sdl_handmade.h"
|
||||||
#include "handmade.cpp"
|
#include "handmade.cpp"
|
||||||
@@ -13,7 +12,7 @@
|
|||||||
#include <unistd.h> // close, read
|
#include <unistd.h> // close, read
|
||||||
|
|
||||||
// NOTE: This is so it compiles on ARM.
|
// NOTE: This is so it compiles on ARM.
|
||||||
#if ARCH_X64 || ARCH_X86
|
#if __x86_64__ || __i386__
|
||||||
#include <x86intrin.h>
|
#include <x86intrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -383,14 +382,14 @@ S32 main(int argc, char *argv[])
|
|||||||
GlobalPerfCountFrequency = SDL_GetPerformanceFrequency();
|
GlobalPerfCountFrequency = SDL_GetPerformanceFrequency();
|
||||||
|
|
||||||
U64 LastCounter;
|
U64 LastCounter;
|
||||||
#if ARCH_X64 || ARCH_X86
|
#if __x86_64__ || __i386__
|
||||||
U64 LastCycleCount;
|
U64 LastCycleCount;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while(GlobalRunning) {
|
while(GlobalRunning) {
|
||||||
LastCounter = SDLGetWallClock();
|
LastCounter = SDLGetWallClock();
|
||||||
|
|
||||||
#if ARCH_X64 || ARCH_X86
|
#if __x86_64__ || __i386__
|
||||||
LastCycleCount = __rdtsc(); // NOTE: rdtsc reports clock cylces, however it is not meant for really precise profiler work as the value returned is varied.
|
LastCycleCount = __rdtsc(); // NOTE: rdtsc reports clock cylces, however it is not meant for really precise profiler work as the value returned is varied.
|
||||||
#endif // Also, __rdtsc is not available on MacOS ARM; I have not checked MacOS x64.
|
#endif // Also, __rdtsc is not available on MacOS ARM; I have not checked MacOS x64.
|
||||||
|
|
||||||
@@ -507,7 +506,7 @@ S32 main(int argc, char *argv[])
|
|||||||
|
|
||||||
LastCounter = EndCounter;
|
LastCounter = EndCounter;
|
||||||
|
|
||||||
#if ARCH_X64 || ARCH_X86
|
#if __x86_64__ || __i386__
|
||||||
U64 EndCycleCount = __rdtsc();
|
U64 EndCycleCount = __rdtsc();
|
||||||
U64 CyclesElapsed = EndCycleCount - LastCycleCount;
|
U64 CyclesElapsed = EndCycleCount - LastCycleCount;
|
||||||
F64 MCPF = ((F64)CyclesElapsed / (1000.0f * 1000.0f));
|
F64 MCPF = ((F64)CyclesElapsed / (1000.0f * 1000.0f));
|
||||||
|
|||||||
Reference in New Issue
Block a user