1 ;*****************************************************************************
2 ;* x86-optimized Float DSP functions
4 ;* This file is part of Libav.
6 ;* Libav is free software; you can redistribute it and/or
7 ;* modify it under the terms of the GNU Lesser General Public
8 ;* License as published by the Free Software Foundation; either
9 ;* version 2.1 of the License, or (at your option) any later version.
11 ;* Libav is distributed in the hope that it will be useful,
12 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ;* Lesser General Public License for more details.
16 ;* You should have received a copy of the GNU Lesser General Public
17 ;* License along with Libav; if not, write to the Free Software
18 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 ;******************************************************************************
22 %include "x86util.asm"
26 ;-----------------------------------------------------------------------------
27 ; void vector_fmul(float *dst, const float *src0, const float *src1, int len)
28 ;-----------------------------------------------------------------------------
30 cglobal vector_fmul, 4,4,2, dst, src0, src1, len
31 lea lenq, [lend*4 - 2*mmsize]
34 mova m0, [src0q + lenq]
35 mova m1, [src0q + lenq + mmsize]
36 mulps m0, m0, [src1q + lenq]
37 mulps m1, m1, [src1q + lenq + mmsize]
38 mova [dstq + lenq], m0
39 mova [dstq + lenq + mmsize], m1
58 ;------------------------------------------------------------------------------
59 ; void ff_vector_fmac_scalar(float *dst, const float *src, float mul, int len)
60 ;------------------------------------------------------------------------------
62 %macro VECTOR_FMAC_SCALAR 0
64 cglobal vector_fmac_scalar, 3,3,3, dst, src, len
66 cglobal vector_fmac_scalar, 4,4,3, dst, src, mul, len
76 vinsertf128 m0, m0, xmm0, 1
79 lea lenq, [lend*4-2*mmsize]
81 mulps m1, m0, [srcq+lenq ]
82 mulps m2, m0, [srcq+lenq+mmsize]
83 addps m1, m1, [dstq+lenq ]
84 addps m2, m2, [dstq+lenq+mmsize]
86 mova [dstq+lenq+mmsize], m2