summaryrefslogtreecommitdiff
path: root/libavcodec/common.h
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2005-04-18 11:24:20 +0000
committerAurelien Jacobs <aurel@gnuage.org>2005-04-18 11:24:20 +0000
commit8230cf0210c9845cfbe291b91c518a062da55c0c (patch)
tree5e63b3876f6486a2ff3e5e5ac197afd2d11ab440 /libavcodec/common.h
parent6c618a263d9f6daa3d836dcc2c3896698de64941 (diff)
add an AMD64 specific implementation of rdtsc()
Originally committed as revision 4135 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/common.h')
-rw-r--r--libavcodec/common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/common.h b/libavcodec/common.h
index 20978aeb28..4d72d88500 100644
--- a/libavcodec/common.h
+++ b/libavcodec/common.h
@@ -457,6 +457,16 @@ if((y)<(x)){\
#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 @@ static inline long long rdtsc(void)
);
return l;
}
+#endif
#define START_TIMER \
uint64_t tend;\