libm_reduce_pi04d.S 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. /*
  2. * Math library
  3. *
  4. * Copyright (C) 2016 Intel Corporation. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in
  14. * the documentation and/or other materials provided with the
  15. * distribution.
  16. * * Neither the name of Intel Corporation nor the names of its
  17. * contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. *
  33. * Author Name <jingwei.zhang@intel.com>
  34. * History:
  35. * 03-14-2016 Initial version. numerics svn rev. 12864
  36. */
  37. .file "libm_reduce_pi04d.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin __libm_reduce_pi04d
  41. .text
  42. .align 16,0x90
  43. .hidden __libm_reduce_pi04d
  44. .globl __libm_reduce_pi04d
  45. __libm_reduce_pi04d:
  46. # parameter 1: 8 + %ebp
  47. # parameter 2: 16 + %ebp
  48. # parameter 3: 20 + %ebp
  49. ..B1.1:
  50. ..L1:
  51. pushl %ebp
  52. movl %esp, %ebp
  53. andl $-16, %esp
  54. pushl %esi
  55. pushl %edi
  56. pushl %ebx
  57. subl $36, %esp
  58. movl 16(%ebp), %eax
  59. movl 20(%ebp), %ebx
  60. movl %eax, 8(%esp)
  61. ..B1.2:
  62. fnstcw 26(%esp)
  63. ..B1.3:
  64. movzwl 26(%esp), %ecx
  65. movl %ecx, %edx
  66. andl $768, %edx
  67. cmpl $768, %edx
  68. je ..B1.19
  69. ..B1.4:
  70. orl $-64768, %ecx
  71. movw %cx, 24(%esp)
  72. ..B1.5:
  73. fldcw 24(%esp)
  74. ..B1.6:
  75. movl $1, 12(%esp)
  76. ..B1.7:
  77. movzwl 14(%ebp), %edi
  78. movl %edi, %ecx
  79. andl $32752, %ecx
  80. andl $-32753, %edi
  81. shrl $4, %ecx
  82. movl $1374389535, %eax
  83. lea -200(%ecx), %esi
  84. andl $2047, %esi
  85. shll $4, %esi
  86. orl %esi, %edi
  87. lea -1052(%ecx), %esi
  88. imull %esi
  89. sarl $3, %edx
  90. sarl $31, %esi
  91. subl %esi, %edx
  92. movw %di, 14(%ebp)
  93. fldl 8(%ebp)
  94. imull $-25, %edx, %edi
  95. andl $-134217728, 8(%ebp)
  96. lea -1052(%edi,%ecx), %ecx
  97. fldl 8(%ebp)
  98. cmpl $17, %ecx
  99. call ..L2
  100. ..L2:
  101. popl %ecx
  102. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%ecx), %ecx
  103. fsubr %st, %st(1)
  104. movl %ecx, 20(%esp)
  105. jl ..B1.9
  106. ..B1.8:
  107. fldl _DP@GOTOFF(%ecx,%edx,8)
  108. fmul %st(2), %st
  109. fldl 8+_DP@GOTOFF(%ecx,%edx,8)
  110. incl %edx
  111. fmul %st(2), %st
  112. faddp %st, %st(1)
  113. fstl (%esp)
  114. andl $-1048576, (%esp)
  115. fsubl (%esp)
  116. jmp ..B1.10
  117. ..B1.9:
  118. fldz
  119. ..B1.10:
  120. fld %st(1)
  121. fld %st(2)
  122. fldl 8+_DP@GOTOFF(%ecx,%edx,8)
  123. fmul %st, %st(2)
  124. fmul %st(5), %st
  125. fldl _DP@GOTOFF(%ecx,%edx,8)
  126. fmul %st(6), %st
  127. faddp %st, %st(3)
  128. fxch %st(2)
  129. faddp %st, %st(3)
  130. fld %st(2)
  131. fldl 16+_DP@GOTOFF(%ecx,%edx,8)
  132. fmul %st, %st(2)
  133. fxch %st(2)
  134. faddp %st, %st(3)
  135. fadd %st(2), %st
  136. fstpl (%esp)
  137. movzwl 6(%esp), %ecx
  138. andl $32752, %ecx
  139. shrl $4, %ecx
  140. negl %ecx
  141. addl $1075, %ecx
  142. movl 4(%esp), %esi
  143. cmpl $31, %ecx
  144. movl (%esp), %edi
  145. jbe ..B1.12
  146. ..B1.11:
  147. movl %esi, %edi
  148. movl %edi, %esi
  149. sarl $31, %esi
  150. sarl %cl, %edi
  151. jmp ..B1.13
  152. ..B1.12:
  153. shrdl %cl, %esi, %edi
  154. sarl %cl, %esi
  155. ..B1.13:
  156. movl %edi, (%esp)
  157. cmpl $31, %ecx
  158. movl %esi, 4(%esp)
  159. jbe ..B1.15
  160. ..B1.14:
  161. movl %edi, %esi
  162. movl $0, 16(%esp)
  163. shll %cl, %esi
  164. jmp ..B1.16
  165. ..B1.15:
  166. movl %edi, %eax
  167. shll %cl, %eax
  168. shldl %cl, %edi, %esi
  169. movl %eax, 16(%esp)
  170. ..B1.16:
  171. movl 16(%esp), %ecx
  172. addl %edi, %ebx
  173. movl %ecx, (%esp)
  174. fld %st(3)
  175. movl %esi, 4(%esp)
  176. movl %ebx, %esi
  177. andl $1, %esi
  178. movl 20(%esp), %edi
  179. fxch %st(1)
  180. fmul %st(5), %st
  181. fxch %st(3)
  182. fsubl (%esp)
  183. fldl 24+_DP@GOTOFF(%edi,%edx,8)
  184. fldl 32+_DP@GOTOFF(%edi,%edx,8)
  185. cmpl $0, 12(%esp)
  186. fxch %st(2)
  187. faddl zero_none@GOTOFF(%edi,%esi,8)
  188. faddp %st, %st(4)
  189. fld %st(5)
  190. fmul %st(1), %st
  191. faddp %st, %st(5)
  192. fxch %st(4)
  193. faddp %st, %st(3)
  194. fld %st(4)
  195. fmul %st(1), %st
  196. fxch %st(4)
  197. fmul %st(6), %st
  198. faddp %st, %st(4)
  199. fxch %st(3)
  200. faddp %st, %st(2)
  201. fxch %st(2)
  202. fmul %st(4), %st
  203. fldl 40+_DP@GOTOFF(%edi,%edx,8)
  204. fmul %st, %st(3)
  205. fxch %st(3)
  206. faddp %st, %st(1)
  207. faddp %st, %st(1)
  208. fld %st(2)
  209. fxch %st(2)
  210. fmul %st(4), %st
  211. fxch %st(3)
  212. fmull 56+_DP@GOTOFF(%edi,%edx,8)
  213. fldl 48+_DP@GOTOFF(%edi,%edx,8)
  214. fmul %st, %st(3)
  215. movl 8(%esp), %edx
  216. fxch %st(3)
  217. faddp %st, %st(4)
  218. fxch %st(3)
  219. faddp %st, %st(1)
  220. fxch %st(1)
  221. fmulp %st, %st(3)
  222. fxch %st(1)
  223. faddp %st, %st(2)
  224. faddp %st, %st(1)
  225. fmull .L_2il0floatpacket.0@GOTOFF(%edi)
  226. fstpl (%edx)
  227. je ..B1.18
  228. ..B1.17:
  229. fldcw 26(%esp)
  230. ..B1.18:
  231. movl %ebx, %eax
  232. addl $36, %esp
  233. popl %ebx
  234. popl %edi
  235. popl %esi
  236. movl %ebp, %esp
  237. popl %ebp
  238. ret
  239. ..B1.19:
  240. movl $0, 12(%esp)
  241. jmp ..B1.7
  242. .align 16,0x90
  243. .type __libm_reduce_pi04d,@function
  244. .size __libm_reduce_pi04d,.-__libm_reduce_pi04d
  245. .data
  246. # -- End __libm_reduce_pi04d
  247. .section .rodata, "a"
  248. .align 8
  249. .align 8
  250. .L_2il0floatpacket.0:
  251. .long 0x54442d18,0x3fe921fb
  252. .type .L_2il0floatpacket.0,@object
  253. .size .L_2il0floatpacket.0,8
  254. .align 8
  255. zero_none:
  256. .long 0x00000000,0x00000000
  257. .long 0x00000000,0xbff00000
  258. .type zero_none,@object
  259. .size zero_none,16
  260. .align 4
  261. _DP:
  262. .long 0
  263. .long 0
  264. .long 1610612736
  265. .long 1282694960
  266. .long 0
  267. .long 1256952721
  268. .long 536870912
  269. .long 1229269500
  270. .long 3221225472
  271. .long 1202544455
  272. .long 0
  273. .long 1176818551
  274. .long 2147483648
  275. .long 1148939346
  276. .long 536870912
  277. .long 1124701124
  278. .long 3758096384
  279. .long 1099498527
  280. .long 3758096384
  281. .long 1071929578
  282. .long 1342177280
  283. .long 1046982385
  284. .long 805306368
  285. .long 1020320658
  286. .long 2147483648
  287. .long 993817732
  288. .long 0
  289. .long 968598976
  290. .long 2684354560
  291. .long 942220475
  292. .long 2415919104
  293. .long 915426956
  294. .long 0
  295. .long 885849629
  296. .long 536870912
  297. .long 863855510
  298. .long 1610612736
  299. .long 836031391
  300. .long 4026531840
  301. .long 810828058
  302. .long 1073741824
  303. .long 784674491
  304. .long 1610612736
  305. .long 757207974
  306. .long 3489660928
  307. .long 732020890
  308. .long 0
  309. .long 703061904
  310. .long 1610612736
  311. .long 679713053
  312. .long 2147483648
  313. .long 652001705
  314. .long 1073741824
  315. .long 626850382
  316. .long 2147483648
  317. .long 597786158
  318. .long 805306368
  319. .long 575535400
  320. .long 536870912
  321. .long 548814833
  322. .long 268435456
  323. .long 523239288
  324. .long 3758096384
  325. .long 495550718
  326. .long 2952790016
  327. .long 469954840
  328. .long 1073741824
  329. .long 442925723
  330. .long 1073741824
  331. .long 416247094
  332. .long 3758096384
  333. .long 392128403
  334. .long 2147483648
  335. .long 364254062
  336. .long 3221225472
  337. .long 339643518
  338. .long 2684354560
  339. .long 313162111
  340. .long 805306368
  341. .long 286354345
  342. .long 2952790016
  343. .long 260811902
  344. .long 1610612736
  345. .long 234667567
  346. .long 3758096384
  347. .long 207520668
  348. .long 1073741824
  349. .long 182175017
  350. .long 4026531840
  351. .long 155380331
  352. .long 805306368
  353. .long 129417058
  354. .long 536870912
  355. .long 103691636
  356. .long 0
  357. .long 73760972
  358. .long 3221225472
  359. .long 48348958
  360. .type _DP,@object
  361. .size _DP,392
  362. .data
  363. .section .note.GNU-stack, ""
  364. # End