diff options
author | Lynne <dev@lynne.ee> | 2023-02-01 02:26:20 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2023-02-01 04:23:55 +0100 |
commit | bbe95f7353a972f28a48be8da883549f02c59e4b (patch) | |
tree | 08841c9da55e7f076f6046d1dbd70f49d74c0ec0 /libavcodec/x86/fft.asm | |
parent | fc9a3b584da3cf3fc1f00036be2eaf5dff903ccf (diff) | |
download | ffmpeg-bbe95f7353a972f28a48be8da883549f02c59e4b.tar.gz |
x86: replace explicit REP_RETs with RETs
From x86inc:
> On AMD cpus <=K10, an ordinary ret is slow if it immediately follows either
> a branch or a branch target. So switch to a 2-byte form of ret in that case.
> We can automatically detect "follows a branch", but not a branch target.
> (SSSE3 is a sufficient condition to know that your cpu doesn't have this problem.)
x86inc can automatically determine whether to use REP_RET rather than
REP in most of these cases, so impact is minimal. Additionally, a few
REP_RETs were used unnecessary, despite the return being nowhere near a
branch.
The only CPUs affected were AMD K10s, made between 2007 and 2011, 16
years ago and 12 years ago, respectively.
In the future, everyone involved with x86inc should consider dropping
REP_RETs altogether.
Diffstat (limited to 'libavcodec/x86/fft.asm')
-rw-r--r-- | libavcodec/x86/fft.asm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/x86/fft.asm b/libavcodec/x86/fft.asm index a44596e565..34c3fc9a0f 100644 --- a/libavcodec/x86/fft.asm +++ b/libavcodec/x86/fft.asm @@ -475,7 +475,7 @@ cglobal fft_calc, 2,5,8 mov r0, r1 mov r1, r3 FFT_DISPATCH _interleave %+ SUFFIX, r1 - REP_RET + RET %endif @@ -510,7 +510,7 @@ cglobal fft_calc, 2,5,8 add r2, mmsize*2 jl .loop .end: - REP_RET + RET cglobal fft_permute, 2,7,1 mov r4, [r0 + FFTContext.revtab] @@ -543,7 +543,7 @@ cglobal fft_permute, 2,7,1 movaps [r1 + r2 + 16], xmm1 add r2, 32 jl .loopcopy - REP_RET + RET INIT_XMM sse cglobal imdct_calc, 3,5,3 @@ -583,7 +583,7 @@ cglobal imdct_calc, 3,5,3 sub r3, mmsize add r2, mmsize jl .loop - REP_RET + RET %ifdef PIC %define SECTION_REL - $$ |