diff options
author | Ronald S. Bultje | 2012-07-07 13:30:11 -0700 |
---|---|---|
committer | Ronald S. Bultje | 2012-07-07 13:35:07 -0700 |
commit | 07b287020c9ada750251344c05b52f541be4d533 (patch) | |
tree | e8721a6b7c630193935e952edfaf2c1e6d75b841 /libavutil | |
parent | 25b51b2c44f16f46d6bd5db4f3421ae57909924e (diff) |
x86/timer: implement an intrinsic-based version for rdtsc (AV_READ_TIME).
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/x86/timer.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/x86/timer.h b/libavutil/x86/timer.h index 7f51816c5a..35e614d0d0 100644 --- a/libavutil/x86/timer.h +++ b/libavutil/x86/timer.h @@ -23,6 +23,8 @@ #include <stdint.h> +#if HAVE_INLINE_ASM + #define AV_READ_TIME read_time static inline uint64_t read_time(void) @@ -32,4 +34,10 @@ static inline uint64_t read_time(void) return ((uint64_t)d << 32) + a; } +#elif HAVE_RDTSC + +#define AV_READ_TIME __rdtsc + +#endif /* HAVE_INLINE_ASM */ + #endif /* AVUTIL_X86_TIMER_H */ |