aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-10-21 14:57:55 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-10-21 14:57:55 +0000
commit03092e14089e086065bf05671260347ad94a6262 (patch)
treec06081bd2b6bba452ca4ee402df3aed046654966
parent3d0d9a5e3bbb7eb0e97b588afe1be73c1fbe9075 (diff)
downloadffmpeg-03092e14089e086065bf05671260347ad94a6262.tar.gz
Port read_time() that works on x86_32 and 64 from noe.
Originally committed as revision 15661 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavutil/common.h14
1 files changed, 3 insertions, 11 deletions
diff --git a/libavutil/common.h b/libavutil/common.h
index 7ceaf33890..cd43abd065 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -323,21 +323,13 @@ static inline av_pure int ff_get_fourcc(const char *s){
#if defined(ARCH_X86) || defined(ARCH_POWERPC) || defined(ARCH_BFIN)
#define AV_READ_TIME read_time
-#if defined(ARCH_X86_64)
+#if defined(ARCH_X86)
static inline uint64_t read_time(void)
{
- uint64_t a, d;
+ uint32_t a, d;
__asm__ volatile("rdtsc\n\t"
: "=a" (a), "=d" (d));
- return (d << 32) | (a & 0xffffffff);
-}
-#elif defined(ARCH_X86_32)
-static inline long long read_time(void)
-{
- long long l;
- __asm__ volatile("rdtsc\n\t"
- : "=A" (l));
- return l;
+ return ((uint64_t)d << 32) + a;
}
#elif ARCH_BFIN
static inline uint64_t read_time(void)