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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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 $ZBASE_SHIFT, INCX
  70. fldz
  71. fldz
  72. fldz
  73. cmpl $SIZE * 2, INCX
  74. jne .L40
  75. movl M, I
  76. sarl $2, 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 $3, I
  106. jle .L998
  107. ALIGN_4
  108. .L21:
  109. FLD 0 * SIZE(X)
  110. FLD 1 * SIZE(X)
  111. faddp %st,%st(3)
  112. faddp %st,%st(1)
  113. addl $2 * SIZE, X
  114. decl I
  115. jg .L21
  116. jmp .L998
  117. ALIGN_4
  118. .L40:
  119. movl M, I
  120. sarl $2, I
  121. jle .L60
  122. ALIGN_4
  123. .L50:
  124. FLD 0 * SIZE(X)
  125. FLD 1 * SIZE(X)
  126. addl INCX, X
  127. FLD 0 * SIZE(X)
  128. FLD 1 * SIZE(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 0 * SIZE(X)
  135. FLD 1 * SIZE(X)
  136. addl INCX, X
  137. FLD 0 * SIZE(X)
  138. FLD 1 * SIZE(X)
  139. addl INCX, X
  140. faddp %st, %st(7)
  141. faddp %st, %st(5)
  142. faddp %st, %st(3)
  143. faddp %st, %st(1)
  144. decl I
  145. jg .L50
  146. ALIGN_4
  147. .L60:
  148. movl M, I
  149. andl $3, I
  150. jle .L998
  151. ALIGN_4
  152. .L61:
  153. FLD 0 * SIZE(X)
  154. FLD 1 * SIZE(X)
  155. addl INCX, X
  156. faddp %st,%st(3)
  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