changeset 2613:1c1b53f353ff libavcodec

add an AMD64 specific implementation of rdtsc()
author aurel
date Mon, 18 Apr 2005 11:24:20 +0000
parents 210cca8f5764
children 5e24800ab329
files common.h
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/common.h	Sun Apr 17 21:41:16 2005 +0000
+++ b/common.h	Mon Apr 18 11:24:20 2005 +0000
@@ -457,6 +457,16 @@
 #endif
 
 #if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if defined(ARCH_X86_64)
+static inline uint64_t rdtsc(void)
+{
+	uint64_t a, d;
+	asm volatile(	"rdtsc\n\t"
+		: "=a" (a), "=d" (d)
+	);
+	return (d << 32) | (a & 0xffffffff);
+}
+#else
 static inline long long rdtsc(void)
 {
 	long long l;
@@ -465,6 +475,7 @@
 	);
 	return l;
 }
+#endif
 
 #define START_TIMER \
 uint64_t tend;\