Changeset - r6171:fa4825a564b7
[Not reviewed]
master
0 3 0
KUDr - 17 years ago 2007-02-27 23:12:45
kudr@openttd.org
(svn r8933) -Fix [Win64]: rdtsc now uses intrinsic on VC8 (michi_cc)
3 files changed with 10 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/os_timer.cpp
Show inline comments
 
@@ -7,8 +7,12 @@
 
/* 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(RDTSC_AVAILABLE)
 
# if defined (_M_AMD64)
 
extern uint64 _rdtsc(void);
 
# if _MSC_VER >= 1400
 
#include <intrin.h>
 
uint64 _rdtsc(void)
 
{
 
	return __rdtsc();
 
}
 
#	else
 
uint64 _declspec(naked) _rdtsc(void)
 
{
src/win32.cpp
Show inline comments
 
@@ -606,10 +606,13 @@ static LONG WINAPI ExceptionHandler(EXCE
 
	return EXCEPTION_EXECUTE_HANDLER;
 
}
 

	
 
#ifdef _M_AMD64
 
extern "C" void *_get_save_esp(void);
 
#endif
 

	
 
static void Win32InitializeExceptions(void)
 
{
 
#ifdef _M_AMD64
 
	extern void *_get_save_esp(void);
 
	_safe_esp = _get_save_esp();
 
#else
 
	_asm {
src/win64.asm
Show inline comments
 
@@ -5,13 +5,4 @@ PUBLIC	_get_save_esp
 
		MOV	RAX,RSP
 
		RET
 

	
 
PUBLIC	_rdtsc
 
_rdtsc:
 
		RDTSC
 
		MOV RCX,RDX
 
		SHL RCX,32
 
		AND RAX,0FFFFFFFFh
 
		OR  RAX,RCX
 
		RET
 

	
 
		END
0 comments (0 inline, 0 general)