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. #include "version.h"
  41. .set noat
  42. .set noreorder
  43. .text
  44. .align 5
  45. .globl CNAME
  46. .ent CNAME
  47. CNAME:
  48. .frame $sp, 0, $26, 0
  49. #ifdef PROFILE
  50. ldgp $gp, 0($27)
  51. lda $28, _mcount
  52. jsr $28, ($28), _mcount
  53. .prologue 1
  54. #else
  55. .prologue 0
  56. #endif
  57. ldq $18, 24($sp)
  58. ble $16, $End
  59. ldl $19, 32($sp)
  60. ble $17, $End
  61. addq $19, $19, $19
  62. fbne $f19,$Main
  63. fbne $f20,$Main
  64. .align 4
  65. $L13:
  66. mov $18, $1
  67. lda $17, -1($17)
  68. SXADDQ $19, $18, $18
  69. mov $16, $2
  70. .align 4
  71. $L12:
  72. ST $f31, 0*SIZE($1)
  73. ST $f31, 1*SIZE($1)
  74. lda $2, -1($2)
  75. lda $1, 2*SIZE($1)
  76. bgt $2, $L12
  77. bgt $17,$L13
  78. clr $0
  79. ret
  80. .align 4
  81. /* Main Routine */
  82. $Main:
  83. sra $16, 1, $2 # $2 = (m >> 1)
  84. mov $18, $1 # c_offset = c
  85. lda $17, -1($17) # n --
  86. SXADDQ $19, $18, $18 # c += ldc
  87. beq $2, $L18
  88. LD $f14, 0*SIZE($1)
  89. LD $f15, 1*SIZE($1)
  90. LD $f24, 2*SIZE($1)
  91. LD $f25, 3*SIZE($1)
  92. lda $2, -1($2) # $2 --
  93. ble $2, $L19
  94. .align 4
  95. $L23:
  96. MUL $f19, $f14, $f10
  97. lds $f31, 9*SIZE($1)
  98. MUL $f20, $f15, $f11
  99. lda $2, -1($2)
  100. MUL $f19, $f15, $f12
  101. LD $f15, 5*SIZE($1)
  102. MUL $f20, $f14, $f13
  103. LD $f14, 4*SIZE($1)
  104. MUL $f19, $f24, $f16
  105. unop
  106. MUL $f20, $f25, $f17
  107. unop
  108. MUL $f19, $f25, $f18
  109. LD $f25, 7*SIZE($1)
  110. SUB $f10, $f11, $f22
  111. unop
  112. MUL $f20, $f24, $f21
  113. LD $f24, 6*SIZE($1)
  114. ADD $f12, $f13, $f23
  115. lda $1, 4*SIZE($1)
  116. SUB $f16, $f17, $f26
  117. ADD $f18, $f21, $f27
  118. ST $f22,-4*SIZE($1)
  119. ST $f23,-3*SIZE($1)
  120. ST $f26,-2*SIZE($1)
  121. ST $f27,-1*SIZE($1)
  122. unop
  123. bgt $2,$L23
  124. .align 4
  125. $L19:
  126. MUL $f19, $f14, $f10
  127. MUL $f20, $f15, $f11
  128. MUL $f19, $f15, $f12
  129. MUL $f20, $f14, $f13
  130. MUL $f19, $f24, $f16
  131. MUL $f20, $f25, $f17
  132. MUL $f19, $f25, $f18
  133. MUL $f20, $f24, $f21
  134. SUB $f10, $f11, $f22
  135. ADD $f12, $f13, $f23
  136. SUB $f16, $f17, $f26
  137. ADD $f18, $f21, $f27
  138. lda $1, 4*SIZE($1)
  139. ST $f22, -4*SIZE($1)
  140. ST $f23, -3*SIZE($1)
  141. ST $f26, -2*SIZE($1)
  142. ST $f27, -1*SIZE($1)
  143. blbs $16, $L18
  144. bgt $17, $Main
  145. clr $0
  146. ret
  147. .align 4
  148. $L18:
  149. LD $f14, 0*SIZE($1)
  150. LD $f15, 1*SIZE($1)
  151. MUL $f19, $f15, $f13
  152. MUL $f20, $f14, $f10
  153. MUL $f19, $f14, $f12
  154. MUL $f20, $f15, $f11
  155. ADD $f13, $f10, $f26
  156. SUB $f12, $f11, $f27
  157. ST $f26, 1*SIZE($1)
  158. ST $f27, 0*SIZE($1)
  159. lda $1, 2*SIZE($1)
  160. bgt $17, $Main
  161. .align 4
  162. $End:
  163. clr $0
  164. ret
  165. .ident VERSION
  166. .end CNAME