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.

77 lines
2.7KB

  1. /*
  2. * ARM NEON optimised Format Conversion Utils
  3. * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
  4. * Copyright (c) 2015 Janne Grunau <janne-libav@jannau.net>
  5. *
  6. * This file is part of Libav.
  7. *
  8. * Libav 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. * Libav 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 Libav; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #include "config.h"
  23. #include "libavutil/aarch64/asm.S"
  24. function ff_int32_to_float_fmul_scalar_neon, export=1
  25. ld1 {v1.4s,v2.4s}, [x1], #32
  26. scvtf v1.4s, v1.4s
  27. scvtf v2.4s, v2.4s
  28. 1:
  29. subs w2, w2, #8
  30. fmul v3.4s, v1.4s, v0.s[0]
  31. fmul v4.4s, v2.4s, v0.s[0]
  32. b.le 2f
  33. ld1 {v1.4s,v2.4s}, [x1], #32
  34. st1 {v3.4s,v4.4s}, [x0], #32
  35. scvtf v1.4s, v1.4s
  36. scvtf v2.4s, v2.4s
  37. b 1b
  38. 2:
  39. st1 {v3.4s,v4.4s}, [x0]
  40. ret
  41. endfunc
  42. function ff_int32_to_float_fmul_array8_neon, export=1
  43. lsr w4, w4, #3
  44. subs w5, w4, #1
  45. b.eq 1f
  46. 2:
  47. ld1 {v0.4s,v1.4s}, [x2], #32
  48. ld1 {v2.4s,v3.4s}, [x2], #32
  49. scvtf v0.4s, v0.4s
  50. scvtf v1.4s, v1.4s
  51. ld1 {v16.2s}, [x3], #8
  52. scvtf v2.4s, v2.4s
  53. scvtf v3.4s, v3.4s
  54. fmul v4.4s, v0.4s, v16.s[0]
  55. fmul v5.4s, v1.4s, v16.s[0]
  56. fmul v6.4s, v2.4s, v16.s[1]
  57. fmul v7.4s, v3.4s, v16.s[1]
  58. st1 {v4.4s,v5.4s}, [x1], #32
  59. st1 {v6.4s,v7.4s}, [x1], #32
  60. subs w5, w5, #2
  61. b.gt 2b
  62. b.eq 1f
  63. ret
  64. 1:
  65. ld1 {v0.4s,v1.4s}, [x2]
  66. ld1 {v16.s}[0], [x3]
  67. scvtf v0.4s, v0.4s
  68. scvtf v1.4s, v1.4s
  69. fmul v4.4s, v0.4s, v16.s[0]
  70. fmul v5.4s, v1.4s, v16.s[0]
  71. st1 {v4.4s,v5.4s}, [x1]
  72. ret
  73. endfunc