int_neon.S 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * ARM NEON optimised integer operations
  3. * Copyright (c) 2009 Konstantin Shishkov
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #include "libavutil/arm/asm.S"
  22. function ff_scalarproduct_int16_neon, export=1
  23. vmov.i16 q0, #0
  24. vmov.i16 q1, #0
  25. vmov.i16 q2, #0
  26. vmov.i16 q3, #0
  27. 1: vld1.16 {d16-d17}, [r0]!
  28. vld1.16 {d20-d21}, [r1,:128]!
  29. vmlal.s16 q0, d16, d20
  30. vld1.16 {d18-d19}, [r0]!
  31. vmlal.s16 q1, d17, d21
  32. vld1.16 {d22-d23}, [r1,:128]!
  33. vmlal.s16 q2, d18, d22
  34. vmlal.s16 q3, d19, d23
  35. subs r2, r2, #16
  36. bgt 1b
  37. vpadd.s32 d16, d0, d1
  38. vpadd.s32 d17, d2, d3
  39. vpadd.s32 d18, d4, d5
  40. vpadd.s32 d19, d6, d7
  41. vpadd.s32 d0, d16, d17
  42. vpadd.s32 d1, d18, d19
  43. vpadd.s32 d2, d0, d1
  44. vpaddl.s32 d3, d2
  45. vmov.32 r0, d3[0]
  46. bx lr
  47. endfunc