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.

qdot.S 5.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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. #define STACK 12
  41. #define ARGS 0
  42. #define STACK_N 4 + STACK + ARGS(%esp)
  43. #define STACK_X 8 + STACK + ARGS(%esp)
  44. #define STACK_INCX 12 + STACK + ARGS(%esp)
  45. #define STACK_Y 16 + STACK + ARGS(%esp)
  46. #define STACK_INCY 20 + STACK + ARGS(%esp)
  47. #define N %ebx
  48. #define X %esi
  49. #define INCX %ecx
  50. #define Y %edi
  51. #define INCY %edx
  52. PROLOGUE
  53. pushl %edi
  54. pushl %esi
  55. pushl %ebx
  56. PROFCODE
  57. #if defined(F_INTERFACE_GFORT) || defined(F_INTERFACE_G95)
  58. EMMS
  59. #endif
  60. movl STACK_N, N
  61. movl STACK_X, X
  62. movl STACK_INCX, INCX
  63. movl STACK_Y, Y
  64. movl STACK_INCY, INCY
  65. #ifdef F_INTERFACE
  66. movl (N),N
  67. movl (INCX),INCX
  68. movl (INCY),INCY
  69. #endif
  70. sall $BASE_SHIFT, INCX
  71. sall $BASE_SHIFT, INCY
  72. fldz
  73. fldz
  74. fldz
  75. fldz
  76. cmpl $SIZE, INCX
  77. jne .L14
  78. cmpl $SIZE, INCY
  79. jne .L14
  80. movl N, %eax
  81. sarl $2, %eax
  82. jle .L15
  83. ALIGN_3
  84. .L16:
  85. FLD 0 * SIZE(X)
  86. FLD 0 * SIZE(Y)
  87. fmulp %st, %st(1)
  88. faddp %st,%st(1)
  89. FLD 1 * SIZE(X)
  90. FLD 1 * SIZE(Y)
  91. fmulp %st, %st(1)
  92. faddp %st,%st(2)
  93. FLD 2 * SIZE(X)
  94. FLD 2 * SIZE(Y)
  95. fmulp %st, %st(1)
  96. faddp %st,%st(3)
  97. FLD 3 * SIZE(X)
  98. FLD 3 * SIZE(Y)
  99. fmulp %st, %st(1)
  100. faddp %st,%st(4)
  101. addl $4 * SIZE, X
  102. addl $4 * SIZE, Y
  103. decl %eax
  104. jg .L16
  105. ALIGN_3
  106. .L15:
  107. movl N, %eax
  108. andl $3, %eax
  109. jle .L27
  110. ALIGN_3
  111. .L22:
  112. FLD (X)
  113. addl $SIZE, X
  114. FLD (Y)
  115. fmulp %st, %st(1)
  116. addl $SIZE, Y
  117. faddp %st,%st(1)
  118. decl %eax
  119. jg .L22
  120. jmp .L27
  121. ALIGN_3
  122. .L14:
  123. #ifdef F_INTERFACE
  124. testl INCX, INCX
  125. jge .L28
  126. movl N, %eax
  127. decl %eax
  128. imull INCX, %eax
  129. subl %eax, X
  130. ALIGN_3
  131. .L28:
  132. testl INCY, INCY
  133. jge .L29
  134. movl N, %eax
  135. decl %eax
  136. imull INCY, %eax
  137. subl %eax, Y
  138. ALIGN_3
  139. .L29:
  140. #endif
  141. movl N, %eax
  142. sarl $2, %eax
  143. jle .L30
  144. ALIGN_3
  145. .L31:
  146. FLD (X)
  147. addl INCX, X
  148. FLD (Y)
  149. fmulp %st, %st(1)
  150. addl INCY, Y
  151. faddp %st,%st(1)
  152. FLD (X)
  153. addl INCX, X
  154. FLD (Y)
  155. fmulp %st, %st(1)
  156. addl INCY, Y
  157. faddp %st,%st(2)
  158. FLD (X)
  159. addl INCX, X
  160. FLD (Y)
  161. fmulp %st, %st(1)
  162. addl INCY, Y
  163. faddp %st,%st(3)
  164. FLD (X)
  165. addl INCX, X
  166. FLD (Y)
  167. fmulp %st, %st(1)
  168. addl INCY, Y
  169. faddp %st,%st(4)
  170. decl %eax
  171. jg .L31
  172. ALIGN_3
  173. .L30:
  174. movl N, %eax
  175. andl $3, %eax
  176. jle .L27
  177. ALIGN_3
  178. .L37:
  179. FLD (X)
  180. addl INCX, X
  181. FLD (Y)
  182. fmulp %st, %st(1)
  183. addl INCY, Y
  184. faddp %st, %st(1)
  185. decl %eax
  186. jg .L37
  187. ALIGN_3
  188. .L27:
  189. faddp %st,%st(2)
  190. faddp %st,%st(2)
  191. faddp %st,%st(1)
  192. popl %ebx
  193. popl %esi
  194. popl %edi
  195. ret
  196. EPILOGUE

OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.