You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /***************************************************************************
  2. Copyright (c) 2021, The OpenBLAS Project
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are
  6. met:
  7. 1. Redistributions of source code must retain the above copyright
  8. notice, this list of conditions and the following disclaimer.
  9. 2. Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in
  11. the documentation and/or other materials provided with the
  12. distribution.
  13. 3. Neither the name of the OpenBLAS project nor the names of
  14. its contributors may be used to endorse or promote products
  15. derived from this software without specific prior written permission.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  17. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  19. ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
  20. LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  21. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  22. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  23. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  24. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  25. USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. *****************************************************************************/
  27. #define ASSEMBLER
  28. #include "common.h"
  29. #define N $r4
  30. #define X $r5
  31. #define INCX $r6
  32. #define Y $r7
  33. #define INCY $r8
  34. #define I $r17
  35. #define TEMP $r18
  36. #define a1 $f22
  37. #define a2 $f8
  38. #define a3 $f23
  39. #define a4 $f9
  40. #define a5 $f10
  41. #define a6 $f11
  42. #define a7 $f12
  43. #define a8 $f13
  44. PROLOGUE
  45. #ifdef F_INTERFACE
  46. LDINT N, 0(N)
  47. LDINT INCX, 0(INCX)
  48. LDINT INCY, 0(INCY)
  49. #endif
  50. li.d TEMP, SIZE
  51. NOP
  52. slli.d INCX, INCX, BASE_SHIFT
  53. bge $r0, N, .L999
  54. slli.d INCY, INCY, BASE_SHIFT
  55. bne INCX, TEMP, .L20
  56. srai.d I, N, 3
  57. bne INCY, TEMP, .L20
  58. addi.d I, I, -1
  59. blt I, $r0, .L15
  60. LD a1, X, 0 * SIZE
  61. LD a2, X, 1 * SIZE
  62. LD a3, X, 2 * SIZE
  63. LD a4, X, 3 * SIZE
  64. LD a5, X, 4 * SIZE
  65. LD a6, X, 5 * SIZE
  66. LD a7, X, 6 * SIZE
  67. LD a8, X, 7 * SIZE
  68. bge $r0, I, .L13
  69. .align 3
  70. .L12:
  71. ST a1, Y, 0 * SIZE
  72. LD a1, X, 8 * SIZE
  73. ST a2, Y, 1 * SIZE
  74. LD a2, X, 9 * SIZE
  75. ST a3, Y, 2 * SIZE
  76. LD a3, X, 10 * SIZE
  77. ST a4, Y, 3 * SIZE
  78. LD a4, X, 11 * SIZE
  79. ST a5, Y, 4 * SIZE
  80. LD a5, X, 12 * SIZE
  81. ST a6, Y, 5 * SIZE
  82. LD a6, X, 13 * SIZE
  83. ST a7, Y, 6 * SIZE
  84. LD a7, X, 14 * SIZE
  85. ST a8, Y, 7 * SIZE
  86. LD a8, X, 15 * SIZE
  87. addi.d I, I, -1
  88. addi.d X, X, 8 * SIZE
  89. addi.d Y, Y, 8 * SIZE
  90. blt $r0, I, .L12
  91. .align 3
  92. .L13:
  93. ST a1, Y, 0 * SIZE
  94. ST a2, Y, 1 * SIZE
  95. ST a3, Y, 2 * SIZE
  96. ST a4, Y, 3 * SIZE
  97. ST a5, Y, 4 * SIZE
  98. ST a6, Y, 5 * SIZE
  99. ST a7, Y, 6 * SIZE
  100. ST a8, Y, 7 * SIZE
  101. addi.d X, X, 8 * SIZE
  102. addi.d Y, Y, 8 * SIZE
  103. .align 3
  104. .L15:
  105. andi I, N, 7
  106. bge $r0, I, .L999
  107. .align 3
  108. .L16:
  109. LD a1, X, 0 * SIZE
  110. addi.d X, X, SIZE
  111. addi.d I, I, -1
  112. addi.d Y, Y, SIZE
  113. ST a1, Y, -1 * SIZE
  114. blt $r0, I, .L16
  115. b .L999
  116. .align 3
  117. .L20:
  118. srai.d I, N, 3
  119. addi.d I, I, -1
  120. blt I, $r0, .L25
  121. LD a1, X, 0 * SIZE
  122. add.d X, X, INCX
  123. LD a2, X, 0 * SIZE
  124. add.d X, X, INCX
  125. LD a3, X, 0 * SIZE
  126. add.d X, X, INCX
  127. LD a4, X, 0 * SIZE
  128. add.d X, X, INCX
  129. LD a5, X, 0 * SIZE
  130. add.d X, X, INCX
  131. LD a6, X, 0 * SIZE
  132. add.d X, X, INCX
  133. LD a7, X, 0 * SIZE
  134. add.d X, X, INCX
  135. LD a8, X, 0 * SIZE
  136. add.d X, X, INCX
  137. bge $r0, I, .L23
  138. .align 3
  139. .L22:
  140. ST a1, Y, 0 * SIZE
  141. add.d Y, Y, INCY
  142. LD a1, X, 0 * SIZE
  143. add.d X, X, INCX
  144. ST a2, Y, 0 * SIZE
  145. add.d Y, Y, INCY
  146. LD a2, X, 0 * SIZE
  147. add.d X, X, INCX
  148. ST a3, Y, 0 * SIZE
  149. add.d Y, Y, INCY
  150. LD a3, X, 0 * SIZE
  151. add.d X, X, INCX
  152. ST a4, Y, 0 * SIZE
  153. add.d Y, Y, INCY
  154. LD a4, X, 0 * SIZE
  155. add.d X, X, INCX
  156. ST a5, Y, 0 * SIZE
  157. add.d Y, Y, INCY
  158. LD a5, X, 0 * SIZE
  159. add.d X, X, INCX
  160. ST a6, Y, 0 * SIZE
  161. add.d Y, Y, INCY
  162. LD a6, X, 0 * SIZE
  163. add.d X, X, INCX
  164. ST a7, Y, 0 * SIZE
  165. add.d Y, Y, INCY
  166. LD a7, X, 0 * SIZE
  167. add.d X, X, INCX
  168. ST a8, Y, 0 * SIZE
  169. add.d Y, Y, INCY
  170. LD a8, X, 0 * SIZE
  171. addi.d I, I, -1
  172. add.d X, X, INCX
  173. blt $r0, I, .L22
  174. .align 3
  175. .L23:
  176. ST a1, Y, 0 * SIZE
  177. add.d Y, Y, INCY
  178. ST a2, Y, 0 * SIZE
  179. add.d Y, Y, INCY
  180. ST a3, Y, 0 * SIZE
  181. add.d Y, Y, INCY
  182. ST a4, Y, 0 * SIZE
  183. add.d Y, Y, INCY
  184. ST a5, Y, 0 * SIZE
  185. add.d Y, Y, INCY
  186. ST a6, Y, 0 * SIZE
  187. add.d Y, Y, INCY
  188. ST a7, Y, 0 * SIZE
  189. add.d Y, Y, INCY
  190. ST a8, Y, 0 * SIZE
  191. add.d Y, Y, INCY
  192. .align 3
  193. .L25:
  194. andi I, N, 7
  195. bge $r0, I, .L999
  196. .align 3
  197. .L26:
  198. LD a1, X, 0 * SIZE
  199. add.d X, X, INCX
  200. addi.d I, I, -1
  201. ST a1, Y, 0 * SIZE
  202. add.d Y, Y, INCY
  203. blt $r0, I, .L26
  204. .align 3
  205. .L999:
  206. move $r4, $r17
  207. fmov.d $f0, $f22
  208. jirl $r0, $r1, 0x0
  209. EPILOGUE