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.

sgemm_tcopy_logic_8_power8.S 5.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. /***************************************************************************
  2. Copyright (c) 2013-2016, 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. /**************************************************************************************
  28. * 2016/04/23 Werner Saar (wernsaar@googlemail.com)
  29. * BLASTEST : OK
  30. * CTEST : OK
  31. * TEST : OK
  32. * LAPACK-TEST : OK
  33. **************************************************************************************/
  34. srawi. I, M, 2
  35. ble SCOPYOT_L2_BEGIN
  36. SCOPYOT_L4_BEGIN:
  37. mr A0, A
  38. add A1, A0, LDA
  39. add A2, A1, LDA
  40. add A3, A2, LDA
  41. add A, A3, LDA
  42. mr B8, B
  43. addi B, B, 32*SIZE
  44. sradi. J, N, 3
  45. ble SCOPYOT_L4x4_BEGIN
  46. mr BO, B8
  47. .align 5
  48. SCOPYOT_L4x8_LOOP:
  49. dcbt A0, PREA
  50. dcbt A1, PREA
  51. dcbt A2, PREA
  52. dcbt A3, PREA
  53. COPY_4x8
  54. addi A0, A0, 8*SIZE
  55. addi A1, A1, 8*SIZE
  56. addi A2, A2, 8*SIZE
  57. addi A3, A3, 8*SIZE
  58. add BO, BO, M8
  59. addic. J, J, -1
  60. ble SCOPYOT_L4x4_BEGIN
  61. COPY_4x8
  62. addi A0, A0, 8*SIZE
  63. addi A1, A1, 8*SIZE
  64. addi A2, A2, 8*SIZE
  65. addi A3, A3, 8*SIZE
  66. add BO, BO, M8
  67. addic. J, J, -1
  68. ble SCOPYOT_L4x4_BEGIN
  69. COPY_4x8
  70. addi A0, A0, 8*SIZE
  71. addi A1, A1, 8*SIZE
  72. addi A2, A2, 8*SIZE
  73. addi A3, A3, 8*SIZE
  74. add BO, BO, M8
  75. addic. J, J, -1
  76. ble SCOPYOT_L4x4_BEGIN
  77. COPY_4x8
  78. addi A0, A0, 8*SIZE
  79. addi A1, A1, 8*SIZE
  80. addi A2, A2, 8*SIZE
  81. addi A3, A3, 8*SIZE
  82. add BO, BO, M8
  83. addic. J, J, -1
  84. bgt SCOPYOT_L4x8_LOOP
  85. SCOPYOT_L4x4_BEGIN:
  86. andi. T1, N, 4
  87. ble SCOPYOT_L4x2_BEGIN
  88. mr BO, B4
  89. COPY_4x4
  90. addi A0, A0, 4*SIZE
  91. addi A1, A1, 4*SIZE
  92. addi A2, A2, 4*SIZE
  93. addi A3, A3, 4*SIZE
  94. addi B4, B4, 16*SIZE
  95. SCOPYOT_L4x2_BEGIN:
  96. andi. T1, N, 2
  97. ble SCOPYOT_L4x1_BEGIN
  98. mr BO, B2
  99. COPY_4x2
  100. addi A0, A0, 2*SIZE
  101. addi A1, A1, 2*SIZE
  102. addi A2, A2, 2*SIZE
  103. addi A3, A3, 2*SIZE
  104. addi B2, B2, 8*SIZE
  105. SCOPYOT_L4x1_BEGIN:
  106. andi. T1, N, 1
  107. ble SCOPYOT_L4_END
  108. mr BO, B1
  109. COPY_4x1
  110. addi A0, A0, 1*SIZE
  111. addi A1, A1, 1*SIZE
  112. addi A2, A2, 1*SIZE
  113. addi A3, A3, 1*SIZE
  114. addi B1, B1, 4*SIZE
  115. SCOPYOT_L4_END:
  116. addic. I, I, -1
  117. bgt SCOPYOT_L4_BEGIN
  118. SCOPYOT_L2_BEGIN:
  119. andi. T1, M, 2
  120. ble SCOPYOT_L1_BEGIN
  121. mr A0, A
  122. add A1, A0, LDA
  123. add A, A1, LDA
  124. mr B8, B
  125. addi B, B, 16*SIZE
  126. sradi. J, N, 3
  127. ble SCOPYOT_L2x4_BEGIN
  128. mr BO, B8
  129. SCOPYOT_L2x8_LOOP:
  130. COPY_2x8
  131. addi A0, A0, 8*SIZE
  132. addi A1, A1, 8*SIZE
  133. add BO, BO, M8
  134. addic. J, J, -1
  135. bgt SCOPYOT_L2x8_LOOP
  136. SCOPYOT_L2x4_BEGIN:
  137. andi. T1, N, 4
  138. ble SCOPYOT_L2x2_BEGIN
  139. mr BO, B4
  140. COPY_2x4
  141. addi A0, A0, 4*SIZE
  142. addi A1, A1, 4*SIZE
  143. addi B4, B4, 8*SIZE
  144. SCOPYOT_L2x2_BEGIN:
  145. andi. T1, N, 2
  146. ble SCOPYOT_L2x1_BEGIN
  147. mr BO, B2
  148. COPY_2x2
  149. addi A0, A0, 2*SIZE
  150. addi A1, A1, 2*SIZE
  151. addi B2, B2, 4*SIZE
  152. SCOPYOT_L2x1_BEGIN:
  153. andi. T1, N, 1
  154. ble SCOPYOT_L2_END
  155. mr BO, B1
  156. COPY_2x1
  157. addi A0, A0, 1*SIZE
  158. addi A1, A1, 1*SIZE
  159. addi B1, B1, 2*SIZE
  160. SCOPYOT_L2_END:
  161. SCOPYOT_L1_BEGIN:
  162. andi. T1, M, 1
  163. ble L999
  164. mr A0, A
  165. add A, A0, LDA
  166. mr B8, B
  167. addi B, B, 8*SIZE
  168. sradi. J, N, 3
  169. ble SCOPYOT_L1x4_BEGIN
  170. mr BO, B8
  171. SCOPYOT_L1x8_LOOP:
  172. COPY_1x8
  173. addi A0, A0, 8*SIZE
  174. add BO, BO, M8
  175. addic. J, J, -1
  176. bgt SCOPYOT_L1x8_LOOP
  177. SCOPYOT_L1x4_BEGIN:
  178. andi. T1, N, 4
  179. ble SCOPYOT_L1x2_BEGIN
  180. mr BO, B4
  181. COPY_1x4
  182. addi A0, A0, 4*SIZE
  183. addi B4, B4, 4*SIZE
  184. SCOPYOT_L1x2_BEGIN:
  185. andi. T1, N, 2
  186. ble SCOPYOT_L1x1_BEGIN
  187. mr BO, B2
  188. COPY_1x2
  189. addi A0, A0, 2*SIZE
  190. addi B2, B2, 2*SIZE
  191. SCOPYOT_L1x1_BEGIN:
  192. andi. T1, N, 1
  193. ble SCOPYOT_L1_END
  194. mr BO, B1
  195. COPY_1x1
  196. addi A0, A0, 1*SIZE
  197. addi B1, B1, 1*SIZE
  198. SCOPYOT_L1_END: