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.

asum.S 4.3 kB

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