Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r75549:40d147ae0b10
Date: 2015-01-27 18:28 +0100
http://bitbucket.org/pypy/pypy/changeset/40d147ae0b10/

Log:    Finally, found out why we have issue #900. Trying to fix it.

diff --git a/rpython/translator/c/src/asm_msvc.h 
b/rpython/translator/c/src/asm_msvc.h
--- a/rpython/translator/c/src/asm_msvc.h
+++ b/rpython/translator/c/src/asm_msvc.h
@@ -2,3 +2,14 @@
 #define PYPY_X86_CHECK_SSE2_DEFINED
 RPY_EXTERN void pypy_x86_check_sse2(void);
 #endif
+
+
+/* Provides the same access to RDTSC as used by the JIT backend.  This
+   is needed (at least if the JIT is enabled) because otherwise the
+   JIT-produced assembler would use RDTSC while the non-jitted code
+   would use QueryPerformanceCounter(), giving different incompatible
+   results.  See issue #900.
+*/
+#include <intrin.h>
+#pragma intrinsic(__rdtsc)
+#define READ_TIMESTAMP(val)   do { val = (long long)__rdtsc(); } while (0)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to