Commit aea0f06d authored by James Almer's avatar James Almer

x86/jpeg2000dsp: add ff_ict_float_{fma3,fma4}

jpeg2000_ict_float_c: 2296.0
jpeg2000_ict_float_sse: 628.0
jpeg2000_ict_float_avx: 317.0
jpeg2000_ict_float_fma3: 262.0
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 501435e5
...@@ -74,6 +74,19 @@ align 16 ...@@ -74,6 +74,19 @@ align 16
movaps m1, [src1q+csizeq] movaps m1, [src1q+csizeq]
movaps m2, [src2q+csizeq] movaps m2, [src2q+csizeq]
%if cpuflag(fma4) || cpuflag(fma3)
%if cpuflag(fma4)
fnmaddps m5, m1, ICT1, m0
fmaddps m4, m2, ICT0, m0
%else ; fma3
movaps m5, m1
movaps m4, m2
fnmaddps m5, m5, ICT1, m0
fmaddps m4, m4, ICT0, m0
%endif
fmaddps m0, m1, ICT3, m0
fnmaddps m5, m2, ICT2, m5
%else ; non FMA
%if cpuflag(avx) %if cpuflag(avx)
mulps m5, m1, ICT1 mulps m5, m1, ICT1
mulps m4, m2, ICT0 mulps m4, m2, ICT0
...@@ -93,6 +106,7 @@ align 16 ...@@ -93,6 +106,7 @@ align 16
addps m4, m4, m0 addps m4, m4, m0
addps m0, m0, m1 addps m0, m0, m1
subps m5, m5, m2 subps m5, m5, m2
%endif
movaps [src0q+csizeq], m4 movaps [src0q+csizeq], m4
movaps [src2q+csizeq], m0 movaps [src2q+csizeq], m0
...@@ -106,6 +120,12 @@ INIT_XMM sse ...@@ -106,6 +120,12 @@ INIT_XMM sse
ICT_FLOAT 10 ICT_FLOAT 10
INIT_YMM avx INIT_YMM avx
ICT_FLOAT 9 ICT_FLOAT 9
%if HAVE_FMA4_EXTERNAL
INIT_XMM fma4
ICT_FLOAT 9
%endif
INIT_YMM fma3
ICT_FLOAT 9
;*************************************************************************** ;***************************************************************************
; ff_rct_int_<opt>(int32_t *src0, int32_t *src1, int32_t *src2, int csize) ; ff_rct_int_<opt>(int32_t *src0, int32_t *src1, int32_t *src2, int csize)
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
void ff_ict_float_sse(void *src0, void *src1, void *src2, int csize); void ff_ict_float_sse(void *src0, void *src1, void *src2, int csize);
void ff_ict_float_avx(void *src0, void *src1, void *src2, int csize); void ff_ict_float_avx(void *src0, void *src1, void *src2, int csize);
void ff_ict_float_fma3(void *src0, void *src1, void *src2, int csize);
void ff_ict_float_fma4(void *src0, void *src1, void *src2, int csize);
void ff_rct_int_sse2 (void *src0, void *src1, void *src2, int csize); void ff_rct_int_sse2 (void *src0, void *src1, void *src2, int csize);
void ff_rct_int_avx2 (void *src0, void *src1, void *src2, int csize); void ff_rct_int_avx2 (void *src0, void *src1, void *src2, int csize);
...@@ -44,6 +46,14 @@ av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c) ...@@ -44,6 +46,14 @@ av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
c->mct_decode[FF_DWT97] = ff_ict_float_avx; c->mct_decode[FF_DWT97] = ff_ict_float_avx;
} }
if (EXTERNAL_FMA4(cpu_flags)) {
c->mct_decode[FF_DWT97] = ff_ict_float_fma4;
}
if (EXTERNAL_FMA3_FAST(cpu_flags)) {
c->mct_decode[FF_DWT97] = ff_ict_float_fma3;
}
if (EXTERNAL_AVX2_FAST(cpu_flags)) { if (EXTERNAL_AVX2_FAST(cpu_flags)) {
c->mct_decode[FF_DWT53] = ff_rct_int_avx2; c->mct_decode[FF_DWT53] = ff_rct_int_avx2;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment