fixed_dsp.asm 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ;*****************************************************************************
  2. ;* x86-optimized Float DSP functions
  3. ;*
  4. ;* Copyright 2016 James Almer
  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 "x86util.asm"
  23. SECTION .text
  24. ;-----------------------------------------------------------------------------
  25. ; void ff_butterflies_fixed(float *src0, float *src1, int len);
  26. ;-----------------------------------------------------------------------------
  27. INIT_XMM sse2
  28. cglobal butterflies_fixed, 3,3,3, src0, src1, len
  29. shl lend, 2
  30. add src0q, lenq
  31. add src1q, lenq
  32. neg lenq
  33. align 16
  34. .loop:
  35. mova m0, [src0q + lenq]
  36. mova m1, [src1q + lenq]
  37. mova m2, m0
  38. paddd m0, m1
  39. psubd m2, m1
  40. mova [src0q + lenq], m0
  41. mova [src1q + lenq], m2
  42. add lenq, mmsize
  43. jl .loop
  44. RET