You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8KB

  1. ;*****************************************************************************
  2. ;* x86-optimized Float DSP functions
  3. ;*
  4. ;* Copyright 2006 Loren Merritt
  5. ;*
  6. ;* This file is part of FFmpeg.
  7. ;*
  8. ;* FFmpeg is free software; you can redistribute it and/or
  9. ;* modify it under the terms of the GNU Lesser General Public
  10. ;* License as published by the Free Software Foundation; either
  11. ;* version 2.1 of the License, or (at your option) any later version.
  12. ;*
  13. ;* FFmpeg is distributed in the hope that it will be useful,
  14. ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. ;* Lesser General Public License for more details.
  17. ;*
  18. ;* You should have received a copy of the GNU Lesser General Public
  19. ;* License along with FFmpeg; if not, write to the Free Software
  20. ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. ;******************************************************************************
  22. %include "x86inc.asm"
  23. SECTION .text
  24. ;-----------------------------------------------------------------------------
  25. ; void vector_fmul(float *dst, const float *src0, const float *src1, int len)
  26. ;-----------------------------------------------------------------------------
  27. %macro VECTOR_FMUL 0
  28. cglobal vector_fmul, 4,4,2, dst, src0, src1, len
  29. lea lenq, [lend*4 - 2*mmsize]
  30. ALIGN 16
  31. .loop
  32. mova m0, [src0q + lenq]
  33. mova m1, [src0q + lenq + mmsize]
  34. mulps m0, m0, [src1q + lenq]
  35. mulps m1, m1, [src1q + lenq + mmsize]
  36. mova [dstq + lenq], m0
  37. mova [dstq + lenq + mmsize], m1
  38. sub lenq, 2*mmsize
  39. jge .loop
  40. %if mmsize == 32
  41. vzeroupper
  42. RET
  43. %else
  44. REP_RET
  45. %endif
  46. %endmacro
  47. INIT_XMM sse
  48. VECTOR_FMUL
  49. %if HAVE_AVX
  50. INIT_YMM avx
  51. VECTOR_FMUL
  52. %endif