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.

scal.S 5.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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 ARG4
  42. #define INCX ARG5
  43. #define I %rax
  44. #include "l1param.h"
  45. PROLOGUE
  46. PROFCODE
  47. FLD 8(%rsp)
  48. ftst
  49. fnstsw %ax
  50. andb $68, %ah
  51. je .L300
  52. /* Alpha == ZERO */
  53. cmpq $1, INCX
  54. jne .L104
  55. movq M, I
  56. sarq $3, I
  57. jle .L102
  58. ALIGN_4
  59. .L101:
  60. fld %st
  61. FST 0 * SIZE(X)
  62. fld %st
  63. FST 1 * SIZE(X)
  64. fld %st
  65. FST 2 * SIZE(X)
  66. fld %st
  67. FST 3 * SIZE(X)
  68. fld %st
  69. FST 4 * SIZE(X)
  70. fld %st
  71. FST 5 * SIZE(X)
  72. fld %st
  73. FST 6 * SIZE(X)
  74. fld %st
  75. FST 7 * SIZE(X)
  76. addq $8 * SIZE, X
  77. decq I
  78. jg .L101
  79. ALIGN_4
  80. .L102:
  81. movq M, I
  82. andq $7, I
  83. jle .L999
  84. ALIGN_4
  85. .L103:
  86. fld %st
  87. FST 0 * SIZE(X)
  88. addq $SIZE, X
  89. decq I
  90. jg .L103
  91. jmp .L999
  92. ALIGN_4
  93. .L104:
  94. salq $BASE_SHIFT, INCX
  95. movq M, I
  96. sarq $3, I
  97. jle .L106
  98. ALIGN_4
  99. .L105:
  100. fld %st
  101. FST 0 * SIZE(X)
  102. addq INCX, X
  103. fld %st
  104. FST 0 * SIZE(X)
  105. addq INCX, X
  106. fld %st
  107. FST 0 * SIZE(X)
  108. addq INCX, X
  109. fld %st
  110. FST 0 * SIZE(X)
  111. addq INCX, X
  112. fld %st
  113. FST 0 * SIZE(X)
  114. addq INCX, X
  115. fld %st
  116. FST 0 * SIZE(X)
  117. addq INCX, X
  118. fld %st
  119. FST 0 * SIZE(X)
  120. addq INCX, X
  121. fld %st
  122. FST 0 * SIZE(X)
  123. addq INCX, X
  124. decq I
  125. jg .L105
  126. ALIGN_4
  127. .L106:
  128. movq M, I
  129. andq $7, I
  130. jle .L999
  131. ALIGN_4
  132. .L107:
  133. fld %st
  134. FST 0 * SIZE(X)
  135. addq INCX, X
  136. decq I
  137. jg .L107
  138. jmp .L999
  139. ALIGN_4
  140. /* Alpha != ZERO */
  141. .L300:
  142. cmpq $1,INCX
  143. jne .L304
  144. movq M, I
  145. sarq $3, I
  146. jle .L302
  147. ALIGN_4
  148. .L301:
  149. #ifdef PREFETCHW
  150. PREFETCHW (PREFETCHSIZE + 0) - PREOFFSET(X)
  151. #endif
  152. FLD 0 * SIZE(X)
  153. fmul %st(1), %st
  154. FST 0 * SIZE(X)
  155. FLD 1 * SIZE(X)
  156. fmul %st(1), %st
  157. FST 1 * SIZE(X)
  158. FLD 2 * SIZE(X)
  159. fmul %st(1), %st
  160. FST 2 * SIZE(X)
  161. FLD 3 * SIZE(X)
  162. fmul %st(1), %st
  163. FST 3 * SIZE(X)
  164. FLD 4 * SIZE(X)
  165. fmul %st(1), %st
  166. FST 4 * SIZE(X)
  167. FLD 5 * SIZE(X)
  168. fmul %st(1), %st
  169. FST 5 * SIZE(X)
  170. FLD 6 * SIZE(X)
  171. fmul %st(1), %st
  172. FST 6 * SIZE(X)
  173. FLD 7 * SIZE(X)
  174. fmul %st(1), %st
  175. FST 7 * SIZE(X)
  176. addq $8 * SIZE, X
  177. decq I
  178. jg .L301
  179. ALIGN_4
  180. .L302:
  181. movq M, I
  182. andq $7, I
  183. jle .L999
  184. ALIGN_4
  185. .L303:
  186. FLD 0 * SIZE(X)
  187. fmul %st(1), %st
  188. FST 0 * SIZE(X)
  189. addq $SIZE, X
  190. decq I
  191. jg .L303
  192. jmp .L999
  193. ALIGN_4
  194. .L304:
  195. salq $BASE_SHIFT, INCX
  196. movq M, I
  197. sarq $3, I
  198. jle .L306
  199. ALIGN_4
  200. .L305:
  201. FLD 0 * SIZE(X)
  202. fmul %st(1), %st
  203. FST 0 * SIZE(X)
  204. addq INCX, X
  205. FLD 0 * SIZE(X)
  206. fmul %st(1), %st
  207. FST 0 * SIZE(X)
  208. addq INCX, X
  209. FLD 0 * SIZE(X)
  210. fmul %st(1), %st
  211. FST 0 * SIZE(X)
  212. addq INCX, X
  213. FLD 0 * SIZE(X)
  214. fmul %st(1), %st
  215. FST 0 * SIZE(X)
  216. addq INCX, X
  217. FLD 0 * SIZE(X)
  218. fmul %st(1), %st
  219. FST 0 * SIZE(X)
  220. addq INCX, X
  221. FLD 0 * SIZE(X)
  222. fmul %st(1), %st
  223. FST 0 * SIZE(X)
  224. addq INCX, X
  225. FLD 0 * SIZE(X)
  226. fmul %st(1), %st
  227. FST 0 * SIZE(X)
  228. addq INCX, X
  229. FLD 0 * SIZE(X)
  230. fmul %st(1), %st
  231. FST 0 * SIZE(X)
  232. addq INCX, X
  233. decq I
  234. jg .L305
  235. ALIGN_4
  236. .L306:
  237. movq M, I
  238. andq $7, I
  239. jle .L999
  240. ALIGN_4
  241. .L307:
  242. FLD 0 * SIZE(X)
  243. fmul %st(1), %st
  244. FST 0 * SIZE(X)
  245. addq INCX, X
  246. decq I
  247. jg .L307
  248. ALIGN_4
  249. .L999:
  250. ffreep %st(0)
  251. ret
  252. EPILOGUE