diff --git a/libavutil/x86/timer.h b/libavutil/x86/timer.h
index cdd67ddbb5c7ea40dde9c74194a8612189e633d2..bb7c34134114c2cc62aa3f4ca511d07d4dbe6add 100644
--- a/libavutil/x86/timer.h
+++ b/libavutil/x86/timer.h
@@ -30,7 +30,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;
 }