Skip to content

Commit

Permalink
Add NOT_USE_ASM to Types.h
Browse files Browse the repository at this point in the history
  • Loading branch information
tx00100xt committed Dec 2, 2023
1 parent 8e0f743 commit 5cc4d2b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion SamTFE/Sources/Engine/Base/Profiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ template class CStaticArray<CProfileTimer>;

static inline __int64 ReadTSC_profile(void)
{
#if (defined PLATFORM_NOT_X86) || (defined USE_PORTABLE_C)
#if PLATFORM_NOT_X86 || NOT_USE_ASM
struct timespec tv;
clock_gettime(CLOCK_MONOTONIC, &tv);
return( (((__int64) tv.tv_sec) * 1000) + (((__int64) tv.tv_nsec) / 1000000) );
Expand Down
6 changes: 3 additions & 3 deletions SamTFE/Sources/Engine/Base/Timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
// Read the Pentium TimeStampCounter (or something like that).
static inline __int64 ReadTSC(void)
{
#if (defined PLATFORM_NOT_X86) || (defined USE_PORTABLE_C)
#if PLATFORM_NOT_X86 || NOT_USE_ASM
struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp);
return( (((__int64) tp.tv_sec) * 1000000000LL) + ((__int64) tp.tv_nsec));
Expand Down Expand Up @@ -154,7 +154,7 @@ void sys_precise_clock(uint64_t *result)
(uint64_t) tv.tv_usec;
}

#if (!defined PLATFORM_NOT_X86) || (!defined USE_PORTABLE_C)
#if !PLATFORM_NOT_X86 && !NOT_USE_ASM
// cpu_rdtsc
void cpu_rdtsc(uint64_t* result)
{
Expand Down Expand Up @@ -553,7 +553,7 @@ CTimer::CTimer(BOOL bInterrupt /*=TRUE*/)
_pTimer = this;
tm_bInterrupt = bInterrupt;

#if (defined PLATFORM_NOT_X86) || (defined USE_PORTABLE_C)
#if PLATFORM_NOT_X86 || NOT_USE_ASM
// just use clock_gettime.
tm_llCPUSpeedHZ = tm_llPerformanceCounterFrequency = 1000000000LL;
#elif defined(PLATFORM_WIN32)
Expand Down
3 changes: 3 additions & 0 deletions SamTFE/Sources/Engine/Base/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ MY_STATIC_ASSERT(size_tSize, sizeof(size_t) == sizeof(void*));
#define FPU_REGS "st", "st(1)", "st(2)", "st(3)", "st(4)", "st(5)", "st(6)", "st(7)"
#define MMX_REGS "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7"
#endif
#define NOT_USE_ASM 0
#else
#define NOT_USE_ASM 1
#endif

#ifdef PLATFORM_UNIX /* rcg10042001 */
Expand Down
2 changes: 1 addition & 1 deletion SamTSE/Sources/Engine/Base/Profiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ template class CStaticArray<CProfileTimer>;

static inline __int64 ReadTSC_profile(void)
{
#if (defined PLATFORM_NOT_X86) || (defined USE_PORTABLE_C)
#if PLATFORM_NOT_X86 || NOT_USE_ASM
struct timespec tv;
clock_gettime(CLOCK_MONOTONIC, &tv);
return( (((__int64) tv.tv_sec) * 1000) + (((__int64) tv.tv_nsec) / 1000000) );
Expand Down
6 changes: 3 additions & 3 deletions SamTSE/Sources/Engine/Base/Timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
// Read the Pentium TimeStampCounter (or something like that).
static inline __int64 ReadTSC(void)
{
#if (defined PLATFORM_NOT_X86) || (defined USE_PORTABLE_C)
#if PLATFORM_NOT_X86 || NOT_USE_ASM
struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp);
return( (((__int64) tp.tv_sec) * 1000000000LL) + ((__int64) tp.tv_nsec));
Expand Down Expand Up @@ -154,7 +154,7 @@ void sys_precise_clock(uint64_t *result)
(uint64_t) tv.tv_usec;
}

#if (!defined PLATFORM_NOT_X86) || (!defined USE_PORTABLE_C)
#if !PLATFORM_NOT_X86 && !NOT_USE_ASM
// cpu_rdtsc
void cpu_rdtsc(uint64_t* result)
{
Expand Down Expand Up @@ -553,7 +553,7 @@ CTimer::CTimer(BOOL bInterrupt /*=TRUE*/)
_pTimer = this;
tm_bInterrupt = bInterrupt;

#if (defined PLATFORM_NOT_X86) || (defined USE_PORTABLE_C)
#if PLATFORM_NOT_X86 || NOT_USE_ASM
// just use clock_gettime.
tm_llCPUSpeedHZ = tm_llPerformanceCounterFrequency = 1000000000LL;
#elif defined(PLATFORM_WIN32)
Expand Down
3 changes: 3 additions & 0 deletions SamTSE/Sources/Engine/Base/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ MY_STATIC_ASSERT(size_tSize, sizeof(size_t) == sizeof(void*));
#define FPU_REGS "st", "st(1)", "st(2)", "st(3)", "st(4)", "st(5)", "st(6)", "st(7)"
#define MMX_REGS "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7"
#endif
#define NOT_USE_ASM 0
#else
#define NOT_USE_ASM 1
#endif

#ifdef PLATFORM_UNIX /* rcg10042001 */
Expand Down

0 comments on commit 5cc4d2b

Please sign in to comment.