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.

dgemm_kernel_power9.S 4.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. /***************************************************************************
  2. Copyright (c) 2013-2019, 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. #include "def_vsx.h"
  30. #define LOAD ld
  31. #define STACKSIZE (512 )
  32. #define ALPHA_SP (296+192)(SP)
  33. #define FZERO (304+192)(SP)
  34. #define M r3
  35. #define N r4
  36. #define K r5
  37. #define A r7
  38. #define B r8
  39. #define C r9
  40. #define LDC r10
  41. #define OFFSET r6
  42. #define alpha_r vs18
  43. #define o0 0
  44. #define T4 r12
  45. #define T3 r11
  46. #define C4 r14
  47. #define o8 r15
  48. #define o24 r16
  49. #define C2 r17
  50. #define L r18
  51. #define T1 r19
  52. #define C3 r20
  53. #define TEMP_REG r21
  54. #define I r22
  55. #define J r23
  56. #define AO r24
  57. #define BO r25
  58. #define CO r26
  59. #define o16 r27
  60. #define o32 r28
  61. #define o48 r29
  62. #define PRE r30
  63. #define T2 r31
  64. #include "dgemm_macros_power9.S"
  65. #ifndef NEEDPARAM
  66. PROLOGUE
  67. PROFCODE
  68. addi SP, SP, -STACKSIZE
  69. li r0, 0
  70. stfd f14, 0(SP)
  71. stfd f15, 8(SP)
  72. stfd f16, 16(SP)
  73. stfd f17, 24(SP)
  74. stfd f18, 32(SP)
  75. stfd f19, 40(SP)
  76. stfd f20, 48(SP)
  77. stfd f21, 56(SP)
  78. stfd f22, 64(SP)
  79. stfd f23, 72(SP)
  80. stfd f24, 80(SP)
  81. stfd f25, 88(SP)
  82. stfd f26, 96(SP)
  83. stfd f27, 104(SP)
  84. stfd f28, 112(SP)
  85. stfd f29, 120(SP)
  86. stfd f30, 128(SP)
  87. stfd f31, 136(SP)
  88. std r31, 144(SP)
  89. std r30, 152(SP)
  90. std r29, 160(SP)
  91. std r28, 168(SP)
  92. std r27, 176(SP)
  93. std r26, 184(SP)
  94. std r25, 192(SP)
  95. std r24, 200(SP)
  96. std r23, 208(SP)
  97. std r22, 216(SP)
  98. std r21, 224(SP)
  99. std r20, 232(SP)
  100. std r19, 240(SP)
  101. std r18, 248(SP)
  102. std r17, 256(SP)
  103. std r16, 264(SP)
  104. std r15, 272(SP)
  105. std r14, 280(SP)
  106. stxv vs52, 288(SP)
  107. stxv vs53, 304(SP)
  108. stxv vs54, 320(SP)
  109. stxv vs55, 336(SP)
  110. stxv vs56, 352(SP)
  111. stxv vs57, 368(SP)
  112. stxv vs58, 384(SP)
  113. stxv vs59, 400(SP)
  114. stxv vs60, 416(SP)
  115. stxv vs61, 432(SP)
  116. stxv vs62, 448(SP)
  117. stxv vs63, 464(SP)
  118. stfd f1, ALPHA_SP
  119. stw r0, FZERO
  120. slwi LDC, LDC, BASE_SHIFT
  121. #if defined(TRMMKERNEL)
  122. ld OFFSET, FRAMESLOT(0) + STACKSIZE(SP)
  123. #endif
  124. cmpwi cr0, M, 0
  125. ble .L999_H1
  126. cmpwi cr0, N, 0
  127. ble .L999_H1
  128. cmpwi cr0, K, 0
  129. ble .L999_H1
  130. addi T1, SP, 296+192
  131. li PRE, 384
  132. li o8 , 8
  133. li o16, 16
  134. li o24, 24
  135. li o32, 32
  136. li o48, 48
  137. lxvdsx alpha_r, 0, T1
  138. #include "dgemm_logic_power9.S"
  139. .L999:
  140. addi r3, 0, 0
  141. lfd f14, 0(SP)
  142. lfd f15, 8(SP)
  143. lfd f16, 16(SP)
  144. lfd f17, 24(SP)
  145. lfd f18, 32(SP)
  146. lfd f19, 40(SP)
  147. lfd f20, 48(SP)
  148. lfd f21, 56(SP)
  149. lfd f22, 64(SP)
  150. lfd f23, 72(SP)
  151. lfd f24, 80(SP)
  152. lfd f25, 88(SP)
  153. lfd f26, 96(SP)
  154. lfd f27, 104(SP)
  155. lfd f28, 112(SP)
  156. lfd f29, 120(SP)
  157. lfd f30, 128(SP)
  158. lfd f31, 136(SP)
  159. ld r31, 144(SP)
  160. ld r30, 152(SP)
  161. ld r29, 160(SP)
  162. ld r28, 168(SP)
  163. ld r27, 176(SP)
  164. ld r26, 184(SP)
  165. ld r25, 192(SP)
  166. ld r24, 200(SP)
  167. ld r23, 208(SP)
  168. ld r22, 216(SP)
  169. ld r21, 224(SP)
  170. ld r20, 232(SP)
  171. ld r19, 240(SP)
  172. ld r18, 248(SP)
  173. ld r17, 256(SP)
  174. ld r16, 264(SP)
  175. ld r15, 272(SP)
  176. ld r14, 280(SP)
  177. lxv vs52, 288(SP)
  178. lxv vs53, 304(SP)
  179. lxv vs54, 320(SP)
  180. lxv vs55, 336(SP)
  181. lxv vs56, 352(SP)
  182. lxv vs57, 368(SP)
  183. lxv vs58, 384(SP)
  184. lxv vs59, 400(SP)
  185. lxv vs60, 416(SP)
  186. lxv vs61, 432(SP)
  187. lxv vs62, 448(SP)
  188. lxv vs63, 464(SP)
  189. addi SP, SP, STACKSIZE
  190. blr
  191. EPILOGUE
  192. #endif