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 ;******************************************************************************
21 %include "x86util.asm"
25 ;-----------------------------------------------------------------------------
26 ; void vector_fmul(float *dst, const float *src0, const float *src1, int len)
27 ;-----------------------------------------------------------------------------
29 cglobal vector_fmul, 4,4,2, dst, src0, src1, len
30 lea lenq, [lend*4 - 2*mmsize]
33 mova m0, [src0q + lenq]
34 mova m1, [src0q + lenq + mmsize]
35 mulps m0, m0, [src1q + lenq]
36 mulps m1, m1, [src1q + lenq + mmsize]
37 mova [dstq + lenq], m0
38 mova [dstq + lenq + mmsize], m1
50 ;------------------------------------------------------------------------------
51 ; void ff_vector_fmac_scalar(float *dst, const float *src, float mul, int len)
52 ;------------------------------------------------------------------------------
54 %macro VECTOR_FMAC_SCALAR 0
56 cglobal vector_fmac_scalar, 3,3,3, dst, src, len
58 cglobal vector_fmac_scalar, 4,4,3, dst, src, mul, len
68 vinsertf128 m0, m0, xmm0, 1
71 lea lenq, [lend*4-2*mmsize]
73 mulps m1, m0, [srcq+lenq ]
74 mulps m2, m0, [srcq+lenq+mmsize]
75 addps m1, m1, [dstq+lenq ]
76 addps m2, m2, [dstq+lenq+mmsize]
78 mova [dstq+lenq+mmsize], m2