[pypy-svn] pypy default: Simplify a bit READ_TIMESTAMP on x86-64.

arigo commits-noreply at bitbucket.org
Thu Jan 6 19:50:11 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r40424:6e6a3dc06eea
Date: 2011-01-06 17:47 +0100
http://bitbucket.org/pypy/pypy/changeset/6e6a3dc06eea/

Log:	Simplify a bit READ_TIMESTAMP on x86-64. It generates better code in
	this version.

diff --git a/pypy/translator/c/src/asm_gcc_x86_64.h b/pypy/translator/c/src/asm_gcc_x86_64.h
--- a/pypy/translator/c/src/asm_gcc_x86_64.h
+++ b/pypy/translator/c/src/asm_gcc_x86_64.h
@@ -2,7 +2,7 @@
  */
 
 #define READ_TIMESTAMP(val) do {                        \
-    unsigned int _eax, _edx;                            \
-    asm volatile("rdtsc" : "=a" (_eax), "=d" (_edx));   \
-    val = (((unsigned long) _edx) << 32) | _eax;        \
+    unsigned long _rax, _rdx;                           \
+    asm volatile("rdtsc" : "=rax"(_rax), "=rdx"(_rdx)); \
+    val = (_rdx << 32) | _rax;                          \
 } while (0)


More information about the Pypy-commit mailing list