aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/fft-test.c
diff options
context:
space:
mode:
authorHenrik Gramner <henrik@gramner.com>2015-07-08 22:33:53 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-07-09 00:10:13 +0200
commitd1a6cb195f610978ba5d2351e60f938f7f261d59 (patch)
treee6284fd36096c97d65437f5b62f366e65666fff7 /libavcodec/fft-test.c
parent40af330adf7fde8073271cf2b41ff9adc4c2bba9 (diff)
downloadffmpeg-d1a6cb195f610978ba5d2351e60f938f7f261d59.tar.gz
x86: Serialize rdtsc in read_time()
Improves the accuracy of measurements, especially in short sections. To quote the Intel 64 and IA-32 Architectures Software Developer's Manual: "The RDTSC instruction is not a serializing instruction. It does not necessarily wait until all previous instructions have been executed before reading the counter. Similarly, subsequent instructions may begin execution before the read operation is performed. If software requires RDTSC to be executed only after all previous instructions have completed locally, it can either use RDTSCP (if the processor supports that instruction) or execute the sequence LFENCE;RDTSC." SSE2 is a requirement for lfence so only use it on SSE2-capable systems. Prefer lfence;rdtsc over rdtscp since rdtscp is supported on fewer systems. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/fft-test.c')
0 files changed, 0 insertions, 0 deletions