x86/synth_filter: add synth_filter_fma3

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/293/head
James Almer 11 years ago committed by Michael Niedermayer
parent bc764d786f
commit 7fd64e3e36
  1. 28
      libavcodec/x86/dcadsp.asm
  2. 4
      libavcodec/x86/dcadsp_init.c

@ -230,16 +230,12 @@ DCA_LFE_FIR 1
SHUF m11, ptr2 + j + (15 - 3) * 4 - mmsize, m12
mova m12, [ptr1 + j + mmsize]
%endif
mulps m6, m6, [win + %1 + j + 16 * 4]
FMULADD_PS m2, m6, [win + %1 + j + 16 * 4], m2, m6
mulps m5, m5, [win + %1 + j]
%if ARCH_X86_64
mulps m12, m12, [win + %1 + j + mmsize + 16 * 4]
mulps m11, m11, [win + %1 + j + mmsize]
%endif
addps m2, m2, m6
subps m1, m1, m5
%if ARCH_X86_64
addps m8, m8, m12
FMULADD_PS m8, m12, [win + %1 + j + mmsize + 16 * 4], m8, m12
mulps m11, m11, [win + %1 + j + mmsize]
subps m7, m7, m11
%endif
;~ c += window[i + j + 32] * (synth_buf[16 + i + j])
@ -250,17 +246,11 @@ DCA_LFE_FIR 1
SHUF m12, ptr2 + j + (31 - 3) * 4 - mmsize, m11
mova m11, [ptr1 + j + mmsize + 16 * 4]
%endif
mulps m5, m5, [win + %1 + j + 32 * 4]
mulps m6, m6, [win + %1 + j + 48 * 4]
FMULADD_PS m3, m5, [win + %1 + j + 32 * 4], m3, m5
FMULADD_PS m4, m6, [win + %1 + j + 48 * 4], m4, m6
%if ARCH_X86_64
mulps m11, m11, [win + %1 + j + mmsize + 32 * 4]
mulps m12, m12, [win + %1 + j + mmsize + 48 * 4]
%endif
addps m3, m3, m5
addps m4, m4, m6
%if ARCH_X86_64
addps m9, m9, m11
addps m10, m10, m12
FMULADD_PS m9, m11, [win + %1 + j + mmsize + 32 * 4], m9, m11
FMULADD_PS m10, m12, [win + %1 + j + mmsize + 48 * 4], m10, m12
%endif
sub j, 64 * 4
%endmacro
@ -391,3 +381,7 @@ SYNTH_FILTER
INIT_YMM avx
SYNTH_FILTER
%endif
%if HAVE_FMA3_EXTERNAL
INIT_YMM fma3
SYNTH_FILTER
%endif

@ -82,6 +82,7 @@ SYNTH_FILTER_FUNC(sse)
#endif
SYNTH_FILTER_FUNC(sse2)
SYNTH_FILTER_FUNC(avx)
SYNTH_FILTER_FUNC(fma3)
#endif
av_cold void ff_synth_filter_init_x86(SynthFilterContext *s)
@ -100,5 +101,8 @@ av_cold void ff_synth_filter_init_x86(SynthFilterContext *s)
if (EXTERNAL_AVX(cpu_flags)) {
s->synth_filter_float = synth_filter_avx;
}
if (EXTERNAL_FMA3(cpu_flags)) {
s->synth_filter_float = synth_filter_fma3;
}
#endif
}

Loading…
Cancel
Save