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.

125 lines
2.9KB

  1. /*
  2. * Alpha optimized DSP utils
  3. * Copyright (c) 2002 Falk Hueffner <falk@debian.org>
  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. /*
  22. * These functions are scheduled for pca56. They should work
  23. * reasonably on ev6, though.
  24. */
  25. #include "regdef.h"
  26. .set noat
  27. .set noreorder
  28. .arch pca56
  29. .text
  30. /************************************************************************
  31. * void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels,
  32. * int line_size, int h)
  33. */
  34. .align 6
  35. .globl put_pixels_axp_asm
  36. .ent put_pixels_axp_asm
  37. put_pixels_axp_asm:
  38. .frame sp, 0, ra
  39. .prologue 0
  40. and a1, 7, t0
  41. beq t0, $aligned
  42. .align 4
  43. $unaligned:
  44. ldq_u t0, 0(a1)
  45. ldq_u t1, 8(a1)
  46. addq a1, a2, a1
  47. nop
  48. ldq_u t2, 0(a1)
  49. ldq_u t3, 8(a1)
  50. addq a1, a2, a1
  51. nop
  52. ldq_u t4, 0(a1)
  53. ldq_u t5, 8(a1)
  54. addq a1, a2, a1
  55. nop
  56. ldq_u t6, 0(a1)
  57. ldq_u t7, 8(a1)
  58. extql t0, a1, t0
  59. addq a1, a2, a1
  60. extqh t1, a1, t1
  61. addq a0, a2, t8
  62. extql t2, a1, t2
  63. addq t8, a2, t9
  64. extqh t3, a1, t3
  65. addq t9, a2, ta
  66. extql t4, a1, t4
  67. or t0, t1, t0
  68. extqh t5, a1, t5
  69. or t2, t3, t2
  70. extql t6, a1, t6
  71. or t4, t5, t4
  72. extqh t7, a1, t7
  73. or t6, t7, t6
  74. stq t0, 0(a0)
  75. stq t2, 0(t8)
  76. stq t4, 0(t9)
  77. subq a3, 4, a3
  78. stq t6, 0(ta)
  79. addq ta, a2, a0
  80. bne a3, $unaligned
  81. ret
  82. .align 4
  83. $aligned:
  84. ldq t0, 0(a1)
  85. addq a1, a2, a1
  86. ldq t1, 0(a1)
  87. addq a1, a2, a1
  88. ldq t2, 0(a1)
  89. addq a1, a2, a1
  90. ldq t3, 0(a1)
  91. addq a0, a2, t4
  92. addq a1, a2, a1
  93. addq t4, a2, t5
  94. subq a3, 4, a3
  95. stq t0, 0(a0)
  96. addq t5, a2, t6
  97. stq t1, 0(t4)
  98. addq t6, a2, a0
  99. stq t2, 0(t5)
  100. stq t3, 0(t6)
  101. bne a3, $aligned
  102. ret
  103. .end put_pixels_axp_asm