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.

63 lines
2.2KB

  1. /*
  2. * ARM NEON optimised integer operations
  3. * Copyright (c) 2009 Kostya Shishkov
  4. *
  5. * This file is part of Libav.
  6. *
  7. * Libav 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. * Libav 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 Libav; 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. @ scalarproduct_and_madd_int16(/*aligned*/v0,v1,v2,order,mul)
  23. function ff_scalarproduct_and_madd_int16_neon, export=1
  24. vld1.16 {d28[],d29[]}, [sp]
  25. vmov.i16 q0, #0
  26. vmov.i16 q1, #0
  27. vmov.i16 q2, #0
  28. vmov.i16 q3, #0
  29. mov r12, r0
  30. 1: vld1.16 {d16-d17}, [r0,:128]!
  31. vld1.16 {d18-d19}, [r1]!
  32. vld1.16 {d20-d21}, [r2]!
  33. vld1.16 {d22-d23}, [r0,:128]!
  34. vld1.16 {d24-d25}, [r1]!
  35. vld1.16 {d26-d27}, [r2]!
  36. vmul.s16 q10, q10, q14
  37. vmul.s16 q13, q13, q14
  38. vmlal.s16 q0, d16, d18
  39. vmlal.s16 q1, d17, d19
  40. vadd.s16 q10, q8, q10
  41. vadd.s16 q13, q11, q13
  42. vmlal.s16 q2, d22, d24
  43. vmlal.s16 q3, d23, d25
  44. vst1.16 {q10}, [r12,:128]!
  45. subs r3, r3, #16
  46. vst1.16 {q13}, [r12,:128]!
  47. bne 1b
  48. vpadd.s32 d16, d0, d1
  49. vpadd.s32 d17, d2, d3
  50. vpadd.s32 d18, d4, d5
  51. vpadd.s32 d19, d6, d7
  52. vpadd.s32 d0, d16, d17
  53. vpadd.s32 d1, d18, d19
  54. vpadd.s32 d2, d0, d1
  55. vpaddl.s32 d3, d2
  56. vmov.32 r0, d3[0]
  57. bx lr
  58. endfunc