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.

zgemm_beta.S 4.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /*********************************************************************/
  2. /* Copyright 2009, 2010 The University of Texas at Austin. */
  3. /* All rights reserved. */
  4. /* */
  5. /* Redistribution and use in source and binary forms, with or */
  6. /* without modification, are permitted provided that the following */
  7. /* conditions are met: */
  8. /* */
  9. /* 1. Redistributions of source code must retain the above */
  10. /* copyright notice, this list of conditions and the following */
  11. /* disclaimer. */
  12. /* */
  13. /* 2. Redistributions in binary form must reproduce the above */
  14. /* copyright notice, this list of conditions and the following */
  15. /* disclaimer in the documentation and/or other materials */
  16. /* provided with the distribution. */
  17. /* */
  18. /* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
  19. /* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */
  20. /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
  21. /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
  22. /* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */
  23. /* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
  24. /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
  25. /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
  26. /* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
  27. /* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
  28. /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
  29. /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
  30. /* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
  31. /* POSSIBILITY OF SUCH DAMAGE. */
  32. /* */
  33. /* The views and conclusions contained in the software and */
  34. /* documentation are those of the authors and should not be */
  35. /* interpreted as representing official policies, either expressed */
  36. /* or implied, of The University of Texas at Austin. */
  37. /*********************************************************************/
  38. #define ASSEMBLER
  39. #include "common.h"
  40. .set noat
  41. .set noreorder
  42. .text
  43. .align 5
  44. .globl CNAME
  45. .ent CNAME
  46. CNAME:
  47. .frame $sp, 0, $26, 0
  48. #ifdef PROFILE
  49. ldgp $gp, 0($27)
  50. lda $28, _mcount
  51. jsr $28, ($28), _mcount
  52. .prologue 1
  53. #else
  54. .prologue 0
  55. #endif
  56. ldq $18, 24($sp)
  57. ble $16, $End
  58. ldl $19, 32($sp)
  59. ble $17, $End
  60. addq $19, $19, $19
  61. fbne $f19,$Main
  62. fbne $f20,$Main
  63. .align 4
  64. $L13:
  65. mov $18, $1
  66. lda $17, -1($17)
  67. SXADDQ $19, $18, $18
  68. mov $16, $2
  69. .align 4
  70. $L12:
  71. ST $f31, 0*SIZE($1)
  72. ST $f31, 1*SIZE($1)
  73. lda $2, -1($2)
  74. lda $1, 2*SIZE($1)
  75. bgt $2, $L12
  76. bgt $17,$L13
  77. clr $0
  78. ret
  79. .align 4
  80. /* Main Routine */
  81. $Main:
  82. sra $16, 1, $2 # $2 = (m >> 1)
  83. mov $18, $1 # c_offset = c
  84. lda $17, -1($17) # n --
  85. SXADDQ $19, $18, $18 # c += ldc
  86. beq $2, $L18
  87. LD $f14, 0*SIZE($1)
  88. LD $f15, 1*SIZE($1)
  89. LD $f24, 2*SIZE($1)
  90. LD $f25, 3*SIZE($1)
  91. lda $2, -1($2) # $2 --
  92. ble $2, $L19
  93. .align 4
  94. $L23:
  95. MUL $f19, $f14, $f10
  96. lds $f31, 9*SIZE($1)
  97. MUL $f20, $f15, $f11
  98. lda $2, -1($2)
  99. MUL $f19, $f15, $f12
  100. LD $f15, 5*SIZE($1)
  101. MUL $f20, $f14, $f13
  102. LD $f14, 4*SIZE($1)
  103. MUL $f19, $f24, $f16
  104. unop
  105. MUL $f20, $f25, $f17
  106. unop
  107. MUL $f19, $f25, $f18
  108. LD $f25, 7*SIZE($1)
  109. SUB $f10, $f11, $f22
  110. unop
  111. MUL $f20, $f24, $f21
  112. LD $f24, 6*SIZE($1)
  113. ADD $f12, $f13, $f23
  114. lda $1, 4*SIZE($1)
  115. SUB $f16, $f17, $f26
  116. ADD $f18, $f21, $f27
  117. ST $f22,-4*SIZE($1)
  118. ST $f23,-3*SIZE($1)
  119. ST $f26,-2*SIZE($1)
  120. ST $f27,-1*SIZE($1)
  121. unop
  122. bgt $2,$L23
  123. .align 4
  124. $L19:
  125. MUL $f19, $f14, $f10
  126. MUL $f20, $f15, $f11
  127. MUL $f19, $f15, $f12
  128. MUL $f20, $f14, $f13
  129. MUL $f19, $f24, $f16
  130. MUL $f20, $f25, $f17
  131. MUL $f19, $f25, $f18
  132. MUL $f20, $f24, $f21
  133. SUB $f10, $f11, $f22
  134. ADD $f12, $f13, $f23
  135. SUB $f16, $f17, $f26
  136. ADD $f18, $f21, $f27
  137. lda $1, 4*SIZE($1)
  138. ST $f22, -4*SIZE($1)
  139. ST $f23, -3*SIZE($1)
  140. ST $f26, -2*SIZE($1)
  141. ST $f27, -1*SIZE($1)
  142. blbs $16, $L18
  143. bgt $17, $Main
  144. clr $0
  145. ret
  146. .align 4
  147. $L18:
  148. LD $f14, 0*SIZE($1)
  149. LD $f15, 1*SIZE($1)
  150. MUL $f19, $f15, $f13
  151. MUL $f20, $f14, $f10
  152. MUL $f19, $f14, $f12
  153. MUL $f20, $f15, $f11
  154. ADD $f13, $f10, $f26
  155. SUB $f12, $f11, $f27
  156. ST $f26, 1*SIZE($1)
  157. ST $f27, 0*SIZE($1)
  158. lda $1, 2*SIZE($1)
  159. bgt $17, $Main
  160. .align 4
  161. $End:
  162. clr $0
  163. ret
  164. .ident VERSION
  165. .end CNAME