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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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 8
  41. #define ARGS 0
  42. #define STACK_M 4 + STACK + ARGS(%esp)
  43. #define STACK_X 8 + STACK + ARGS(%esp)
  44. #define STACK_INCX 12 + STACK + ARGS(%esp)
  45. #define M %edx
  46. #define X %ecx
  47. #define INCX %esi
  48. #define I %eax
  49. #include "l1param.h"
  50. PROLOGUE
  51. pushl %esi
  52. pushl %ebx
  53. PROFCODE
  54. #if defined(F_INTERFACE_GFORT) || defined(F_INTERFACE_G95)
  55. EMMS
  56. #endif
  57. movl STACK_M, M
  58. movl STACK_X, X
  59. movl STACK_INCX, INCX
  60. #ifdef F_INTERFACE
  61. movl (M), M
  62. movl (INCX), INCX
  63. #endif
  64. fldz
  65. testl M, M
  66. jle .L999
  67. testl INCX, INCX
  68. jle .L999
  69. sall $BASE_SHIFT, INCX
  70. fldz
  71. fldz
  72. fldz
  73. cmpl $SIZE, INCX
  74. jne .L40
  75. movl M, I
  76. sarl $3, I
  77. jle .L20
  78. ALIGN_4
  79. .L10:
  80. #ifdef PREFETCH
  81. PREFETCH (PREFETCHSIZE + 0) - PREOFFSET(X)
  82. #endif
  83. FLD 0 * SIZE(X)
  84. FLD 1 * SIZE(X)
  85. FLD 2 * SIZE(X)
  86. FLD 3 * SIZE(X)
  87. faddp %st, %st(7)
  88. faddp %st, %st(5)
  89. faddp %st, %st(3)
  90. faddp %st, %st(1)
  91. FLD 4 * SIZE(X)
  92. FLD 5 * SIZE(X)
  93. FLD 6 * SIZE(X)
  94. FLD 7 * SIZE(X)
  95. addl $8 * SIZE, X
  96. faddp %st, %st(7)
  97. faddp %st, %st(5)
  98. faddp %st, %st(3)
  99. faddp %st, %st(1)
  100. decl I
  101. jg .L10
  102. ALIGN_4
  103. .L20:
  104. movl M, I
  105. andl $7, I
  106. jle .L998
  107. ALIGN_4
  108. .L21:
  109. FLD (X)
  110. faddp %st,%st(1)
  111. addl $1 * SIZE, X
  112. decl I
  113. jg .L21
  114. jmp .L998
  115. ALIGN_4
  116. .L40:
  117. movl M, I
  118. sarl $3, I
  119. jle .L60
  120. ALIGN_4
  121. .L50:
  122. FLD (X)
  123. addl INCX, X
  124. FLD (X)
  125. addl INCX, X
  126. FLD (X)
  127. addl INCX, X
  128. FLD (X)
  129. addl INCX, X
  130. faddp %st, %st(7)
  131. faddp %st, %st(5)
  132. faddp %st, %st(3)
  133. faddp %st, %st(1)
  134. FLD (X)
  135. addl INCX, X
  136. FLD (X)
  137. addl INCX, X
  138. FLD (X)
  139. addl INCX, X
  140. FLD (X)
  141. addl INCX, X
  142. faddp %st, %st(7)
  143. faddp %st, %st(5)
  144. faddp %st, %st(3)
  145. faddp %st, %st(1)
  146. decl I
  147. jg .L50
  148. ALIGN_4
  149. .L60:
  150. movl M, I
  151. andl $7, I
  152. jle .L998
  153. ALIGN_4
  154. .L61:
  155. FLD (X)
  156. addl INCX, X
  157. faddp %st,%st(1)
  158. decl I
  159. jg .L61
  160. ALIGN_4
  161. .L998:
  162. faddp %st,%st(2)
  163. faddp %st,%st(1)
  164. faddp %st,%st(1)
  165. ALIGN_4
  166. .L999:
  167. popl %ebx
  168. popl %esi
  169. ret
  170. EPILOGUE