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.

zasum.S 4.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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. fabs
  85. FLD 1 * SIZE(X)
  86. fabs
  87. FLD 2 * SIZE(X)
  88. fabs
  89. FLD 3 * SIZE(X)
  90. fabs
  91. faddp %st, %st(7)
  92. faddp %st, %st(5)
  93. faddp %st, %st(3)
  94. faddp %st, %st(1)
  95. FLD 4 * SIZE(X)
  96. fabs
  97. FLD 5 * SIZE(X)
  98. fabs
  99. FLD 6 * SIZE(X)
  100. fabs
  101. FLD 7 * SIZE(X)
  102. fabs
  103. addl $8 * SIZE, X
  104. faddp %st, %st(7)
  105. faddp %st, %st(5)
  106. faddp %st, %st(3)
  107. faddp %st, %st(1)
  108. decl I
  109. jg .L10
  110. ALIGN_4
  111. .L20:
  112. movl M, I
  113. andl $3, I
  114. jle .L998
  115. ALIGN_4
  116. .L21:
  117. FLD 0 * SIZE(X)
  118. fabs
  119. FLD 1 * SIZE(X)
  120. fabs
  121. faddp %st,%st(3)
  122. faddp %st,%st(1)
  123. addl $2 * SIZE, X
  124. decl I
  125. jg .L21
  126. jmp .L998
  127. ALIGN_4
  128. .L40:
  129. movl M, I
  130. sarl $2, I
  131. jle .L60
  132. ALIGN_4
  133. .L50:
  134. FLD 0 * SIZE(X)
  135. fabs
  136. FLD 1 * SIZE(X)
  137. addl INCX, X
  138. fabs
  139. FLD 0 * SIZE(X)
  140. fabs
  141. FLD 1 * SIZE(X)
  142. addl INCX, X
  143. fabs
  144. faddp %st, %st(7)
  145. faddp %st, %st(5)
  146. faddp %st, %st(3)
  147. faddp %st, %st(1)
  148. FLD 0 * SIZE(X)
  149. fabs
  150. FLD 1 * SIZE(X)
  151. addl INCX, X
  152. fabs
  153. FLD 0 * SIZE(X)
  154. fabs
  155. FLD 1 * SIZE(X)
  156. addl INCX, X
  157. fabs
  158. faddp %st, %st(7)
  159. faddp %st, %st(5)
  160. faddp %st, %st(3)
  161. faddp %st, %st(1)
  162. decl I
  163. jg .L50
  164. ALIGN_4
  165. .L60:
  166. movl M, I
  167. andl $3, I
  168. jle .L998
  169. ALIGN_4
  170. .L61:
  171. FLD 0 * SIZE(X)
  172. fabs
  173. FLD 1 * SIZE(X)
  174. addl INCX, X
  175. fabs
  176. faddp %st,%st(3)
  177. faddp %st,%st(1)
  178. decl I
  179. jg .L61
  180. ALIGN_4
  181. .L998:
  182. faddp %st,%st(2)
  183. faddp %st,%st(1)
  184. faddp %st,%st(1)
  185. ALIGN_4
  186. .L999:
  187. popl %ebx
  188. popl %esi
  189. ret
  190. EPILOGUE