diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-07-09 12:27:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-07-09 12:28:09 +0200 |
commit | 2ecbf44f21c09f8f03bf142b6ce033d5da2cd731 (patch) | |
tree | 2c6ada8ffe22c695ed6cae7512366a862bbc0c35 /libavutil/x86/timer.h | |
parent | 7e85727b984a605f1824fe076b58bf8209d83999 (diff) | |
parent | d1a6cb195f610978ba5d2351e60f938f7f261d59 (diff) | |
download | ffmpeg-2ecbf44f21c09f8f03bf142b6ce033d5da2cd731.tar.gz |
Merge commit 'd1a6cb195f610978ba5d2351e60f938f7f261d59'
* commit 'd1a6cb195f610978ba5d2351e60f938f7f261d59':
x86: Serialize rdtsc in read_time()
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/x86/timer.h')
-rw-r--r-- | libavutil/x86/timer.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavutil/x86/timer.h b/libavutil/x86/timer.h index 5b24b511c1..4d1e88def0 100644 --- a/libavutil/x86/timer.h +++ b/libavutil/x86/timer.h @@ -31,7 +31,12 @@ static inline uint64_t read_time(void) { uint32_t a, d; - __asm__ volatile("rdtsc" : "=a" (a), "=d" (d)); + __asm__ volatile( +#if ARCH_X86_64 || defined(__SSE2__) + "lfence \n\t" +#endif + "rdtsc \n\t" + : "=a" (a), "=d" (d)); return ((uint64_t)d << 32) + a; } |