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_tcopy_16_power8.S 6.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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/21 Werner Saar (wernsaar@googlemail.com)
  29. * BLASTEST : OK
  30. * CTEST : OK
  31. * TEST : OK
  32. * LAPACK-TEST : OK
  33. **************************************************************************************/
  34. /*********************************************************************/
  35. /* Copyright 2009, 2010 The University of Texas at Austin. */
  36. /* All rights reserved. */
  37. /* */
  38. /* Redistribution and use in source and binary forms, with or */
  39. /* without modification, are permitted provided that the following */
  40. /* conditions are met: */
  41. /* */
  42. /* 1. Redistributions of source code must retain the above */
  43. /* copyright notice, this list of conditions and the following */
  44. /* disclaimer. */
  45. /* */
  46. /* 2. Redistributions in binary form must reproduce the above */
  47. /* copyright notice, this list of conditions and the following */
  48. /* disclaimer in the documentation and/or other materials */
  49. /* provided with the distribution. */
  50. /* */
  51. /* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
  52. /* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */
  53. /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
  54. /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
  55. /* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */
  56. /* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
  57. /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
  58. /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
  59. /* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
  60. /* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
  61. /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
  62. /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
  63. /* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
  64. /* POSSIBILITY OF SUCH DAMAGE. */
  65. /* */
  66. /* The views and conclusions contained in the software and */
  67. /* documentation are those of the authors and should not be */
  68. /* interpreted as representing official policies, either expressed */
  69. /* or implied, of The University of Texas at Austin. */
  70. /*********************************************************************/
  71. #define ASSEMBLER
  72. #include "common.h"
  73. #include "def_vsx.h"
  74. #define M r3
  75. #define N r4
  76. #define A r5
  77. #define LDA r6
  78. #define B r7
  79. #define A0 r8
  80. #define A1 r9
  81. #define A2 r10
  82. #define A3 r11
  83. #define J r12
  84. #define PREA r14
  85. #define PREB r15
  86. #define BO r16
  87. #define B8 r17
  88. #define B4 r18
  89. #define B2 r19
  90. #define B1 r20
  91. #define o8 r21
  92. #define T2 r22
  93. #define I r23
  94. #define o16 r24
  95. #define o32 r25
  96. #define o48 r26
  97. #define B16 r29
  98. #define M16 r30
  99. #define T1 r31
  100. #define o0 0
  101. #ifdef POWER10
  102. #include "dgemm_tcopy_macros_16_power10.S"
  103. #endif
  104. #include "dgemm_tcopy_macros_16_power8.S"
  105. #define STACKSIZE 144
  106. PROLOGUE
  107. PROFCODE
  108. addi SP, SP, -STACKSIZE
  109. li r0, 0
  110. std r14,0(SP)
  111. std r15,8(SP)
  112. std r16,16(SP)
  113. std r17,24(SP)
  114. std r18,32(SP)
  115. std r19,40(SP)
  116. std r20,48(SP)
  117. std r21,56(SP)
  118. std r22,64(SP)
  119. std r23,72(SP)
  120. std r24,80(SP)
  121. std r25,88(SP)
  122. std r26,96(SP)
  123. std r27,104(SP)
  124. std r28,112(SP)
  125. std r29,120(SP)
  126. std r30,128(SP)
  127. std r31,136(SP)
  128. cmpwi cr0, M, 0
  129. ble- L999
  130. cmpwi cr0, N, 0
  131. ble- L999
  132. slwi LDA, LDA, BASE_SHIFT
  133. slwi M16, M, 4 + BASE_SHIFT
  134. li T1, -16
  135. li T2, -8
  136. li PREA, -4
  137. li PREB, -2
  138. and B8, N, T1
  139. and B4, N, T2
  140. and B2, N, PREA
  141. and B1, N, PREB
  142. mullw B8, B8, M
  143. mullw B4, B4, M
  144. mullw B2, B2, M
  145. mullw B1, B1, M
  146. slwi B8, B8, BASE_SHIFT
  147. slwi B4, B4, BASE_SHIFT
  148. slwi B2, B2, BASE_SHIFT
  149. slwi B1, B1, BASE_SHIFT
  150. add B8, B8, B
  151. add B4, B4, B
  152. add B2, B2, B
  153. add B1, B1, B
  154. li PREA, 384
  155. addi PREB, M16, 128
  156. li o8, 8
  157. li o16, 16
  158. li o32, 32
  159. li o48, 48
  160. #include "dgemm_tcopy_logic_16_power8.S"
  161. L999:
  162. li r3, 0
  163. ld r14,0(SP)
  164. ld r15,8(SP)
  165. ld r16,16(SP)
  166. ld r17,24(SP)
  167. ld r18,32(SP)
  168. ld r19,40(SP)
  169. ld r20,48(SP)
  170. ld r21,56(SP)
  171. ld r22,64(SP)
  172. ld r23,72(SP)
  173. ld r24,80(SP)
  174. ld r25,88(SP)
  175. ld r26,96(SP)
  176. ld r27,104(SP)
  177. ld r28,112(SP)
  178. ld r29,120(SP)
  179. ld r30,128(SP)
  180. ld r31,136(SP)
  181. addi SP, SP, STACKSIZE
  182. blr
  183. EPILOGUE