[cairo-commit] perf/cairo-perf-posix.c

M. Joonas Pihlaja joonas at kemper.freedesktop.org
Wed Sep 24 14:22:26 PDT 2008


 perf/cairo-perf-posix.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 55e06745a639d86921e48ff56aa0c375a46d6421
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date:   Thu Sep 25 00:17:57 2008 +0300

    [perf-suite] Explicitly read the results of rdtsc from edx:eax.
    
    The =A format used to read a 64 bit result from rdtsc works on x86,
    but not on x86-64.

diff --git a/perf/cairo-perf-posix.c b/perf/cairo-perf-posix.c
index 8bf78ce..8bc4e09 100644
--- a/perf/cairo-perf-posix.c
+++ b/perf/cairo-perf-posix.c
@@ -70,9 +70,9 @@
 static inline cairo_perf_ticks_t
 oil_profile_stamp_rdtsc (void)
 {
-    uint64_t ts;
-    __asm__ __volatile__("rdtsc\n" : "=A" (ts));
-    return ts;
+    unsigned a, d; 
+    __asm__ __volatile__("rdtsc" : "=a" (a), "=d" (d)); 
+    return ((uint64_t)a) | (((uint64_t)d) << 32); 
 }
 #define OIL_STAMP oil_profile_stamp_rdtsc
 #endif


More information about the cairo-commit mailing list