libm_expl_k80.S 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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_expl_k80.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin __libm_expl_k80
  41. .text
  42. .align 16,0x90
  43. .hidden __libm_expl_k80
  44. .globl __libm_expl_k80
  45. __libm_expl_k80:
  46. # parameter 1: 8 + %ebp
  47. # parameter 2: 12 + %ebp
  48. ..B1.1:
  49. ..L1:
  50. pushl %ebp
  51. movl %esp, %ebp
  52. andl $-16, %esp
  53. pushl %edi
  54. pushl %ebx
  55. subl $40, %esp
  56. movl 12(%ebp), %ebx
  57. movl 8(%ebp), %ecx
  58. call ..L2
  59. ..L2:
  60. popl %edx
  61. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%edx), %edx
  62. fldt (%ebx)
  63. movzbl 9(%ebx), %eax
  64. movzwl 8(%ebx), %edi
  65. andl $128, %eax
  66. andl $32767, %edi
  67. shrl $7, %eax
  68. fstpt 24(%esp)
  69. fldt 24(%esp)
  70. cmpl $32767, %edi
  71. fldt 12(%ebx)
  72. je ..B1.11
  73. ..B1.2:
  74. cmpl $16358, %edi
  75. jge ..B1.7
  76. ..B1.3:
  77. fldt .L_2il0floatpacket.0@GOTOFF(%edx)
  78. cmpl $16183, %edi
  79. jge ..B1.5
  80. ..B1.4:
  81. fstp %st(2)
  82. fstp %st(0)
  83. fldt .L_2il0floatpacket.1@GOTOFF(%edx)
  84. fstpt 12(%ecx)
  85. fldt 12(%ecx)
  86. fxch %st(1)
  87. fstpt (%ecx)
  88. addl $40, %esp
  89. popl %ebx
  90. popl %edi
  91. movl %ebp, %esp
  92. popl %ebp
  93. ret
  94. ..B1.5:
  95. fldt 12+_P1@GOTOFF(%edx)
  96. fmul %st(3), %st
  97. fldt _P1@GOTOFF(%edx)
  98. faddp %st, %st(1)
  99. fmul %st(3), %st
  100. fmul %st(3), %st
  101. faddp %st, %st(3)
  102. fld %st(0)
  103. fadd %st(3), %st
  104. fstpt (%ecx)
  105. fldt (%ecx)
  106. fsubrp %st, %st(1)
  107. faddp %st, %st(2)
  108. faddp %st, %st(1)
  109. fstpt 12(%ecx)
  110. fldt .L_2il0floatpacket.1@GOTOFF(%edx)
  111. ..B1.6:
  112. addl $40, %esp
  113. popl %ebx
  114. popl %edi
  115. movl %ebp, %esp
  116. popl %ebp
  117. ret
  118. ..B1.7:
  119. cmpl $16405, %edi
  120. jge ..B1.9
  121. ..B1.8:
  122. fldt _KLN2@GOTOFF(%edx)
  123. fmulp %st, %st(2)
  124. fldt _TWO_63H@GOTOFF(%edx)
  125. fadd %st, %st(2)
  126. fxch %st(2)
  127. fstpt (%esp)
  128. fldt (%esp)
  129. movl (%esp), %eax
  130. fsubp %st, %st(2)
  131. fldt 24(%esp)
  132. fldt _LN2K@GOTOFF(%edx)
  133. fmul %st(3), %st
  134. fstpt (%esp)
  135. fxch %st(2)
  136. fchs
  137. fldt (%esp)
  138. movsbl %al, %ebx
  139. fsubrp %st, %st(3)
  140. fldt 12+_LN2K@GOTOFF(%edx)
  141. subl %ebx, %eax
  142. fmulp %st, %st(1)
  143. fstpt (%esp)
  144. fldt (%esp)
  145. shll $4, %ebx
  146. fadd %st(2), %st
  147. fld %st(0)
  148. sarl $8, %eax
  149. fsub %st(3), %st
  150. fld %st(1)
  151. movl %eax, 16(%esp)
  152. fsub %st(1), %st
  153. fsubrp %st, %st(4)
  154. fldt (%esp)
  155. fsubp %st, %st(1)
  156. faddp %st, %st(3)
  157. fld %st(1)
  158. fadd %st(1), %st
  159. fld %st(0)
  160. fmul %st(1), %st
  161. fld %st(2)
  162. fsub %st(2), %st
  163. fchs
  164. fld %st(0)
  165. fsubr %st(3), %st
  166. fsubrp %st, %st(4)
  167. fsubrp %st, %st(4)
  168. fxch %st(2)
  169. faddp %st, %st(3)
  170. fxch %st(3)
  171. faddp %st, %st(2)
  172. fldt 48+_P@GOTOFF(%edx)
  173. fmul %st(1), %st
  174. fildl 16(%esp)
  175. fldt 24+_P@GOTOFF(%edx)
  176. faddp %st, %st(2)
  177. fxch %st(1)
  178. fmul %st(2), %st
  179. fldt _P@GOTOFF(%edx)
  180. faddp %st, %st(1)
  181. fmul %st(2), %st
  182. fldt 36+_P@GOTOFF(%edx)
  183. fmul %st(3), %st
  184. fldt 12+_P@GOTOFF(%edx)
  185. faddp %st, %st(1)
  186. fmulp %st, %st(3)
  187. fxch %st(2)
  188. fmul %st(4), %st
  189. faddp %st, %st(2)
  190. fxch %st(2)
  191. faddp %st, %st(1)
  192. fldl 2056+__libm_expl_table_256@GOTOFF(%edx,%ebx)
  193. fldl 2048+__libm_expl_table_256@GOTOFF(%edx,%ebx)
  194. fld %st(0)
  195. fmul %st(3), %st
  196. fxch %st(3)
  197. fadd %st(5), %st
  198. fmul %st(2), %st
  199. faddp %st, %st(3)
  200. fmul %st, %st(4)
  201. fld %st(0)
  202. fadd %st(5), %st
  203. fsubr %st, %st(1)
  204. fxch %st(5)
  205. faddp %st, %st(1)
  206. faddp %st, %st(1)
  207. faddp %st, %st(1)
  208. fld %st(2)
  209. fadd %st(1), %st
  210. fstpt (%ecx)
  211. fldt (%ecx)
  212. fsubrp %st, %st(3)
  213. faddp %st, %st(2)
  214. fxch %st(1)
  215. fstpt 12(%ecx)
  216. addl $40, %esp
  217. popl %ebx
  218. popl %edi
  219. movl %ebp, %esp
  220. popl %ebp
  221. ret
  222. ..B1.9:
  223. fstp %st(1)
  224. fstp %st(0)
  225. fldt .L_2il0floatpacket.1@GOTOFF(%edx)
  226. lea (,%eax,8), %ebx
  227. fstpt 12(%ecx)
  228. lea (%ebx,%eax,4), %eax
  229. fldt _inf_zeros@GOTOFF(%edx,%eax)
  230. fstpt (%ecx)
  231. fldt (%ecx)
  232. ..B1.10:
  233. addl $40, %esp
  234. popl %ebx
  235. popl %edi
  236. movl %ebp, %esp
  237. popl %ebp
  238. ret
  239. ..B1.11:
  240. fstp %st(0)
  241. cmpl $-2147483648, 28(%esp)
  242. jne ..B1.15
  243. ..B1.12:
  244. cmpl $0, 24(%esp)
  245. jne ..B1.15
  246. ..B1.13:
  247. fstp %st(0)
  248. lea (,%eax,8), %ebx
  249. lea (%ebx,%eax,4), %eax
  250. fldt _inf_zeros@GOTOFF(%edx,%eax)
  251. ..B1.15:
  252. fldt .L_2il0floatpacket.1@GOTOFF(%edx)
  253. fstpt 12(%ecx)
  254. fstpt (%ecx)
  255. fldt (%ecx)
  256. addl $40, %esp
  257. popl %ebx
  258. popl %edi
  259. movl %ebp, %esp
  260. popl %ebp
  261. ret
  262. .align 16,0x90
  263. .type __libm_expl_k80,@function
  264. .size __libm_expl_k80,.-__libm_expl_k80
  265. .data
  266. # -- End __libm_expl_k80
  267. .section .rodata, "a"
  268. .align 16
  269. .align 16
  270. .L_2il0floatpacket.0:
  271. .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x3f,0x00,0x00
  272. .type .L_2il0floatpacket.0,@object
  273. .size .L_2il0floatpacket.0,12
  274. .space 4, 0x00 # pad
  275. .align 16
  276. .L_2il0floatpacket.1:
  277. .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
  278. .type .L_2il0floatpacket.1,@object
  279. .size .L_2il0floatpacket.1,12
  280. .align 2
  281. _P1:
  282. .word 43691
  283. .word 10
  284. .word 0
  285. .word 32768
  286. .word 16382
  287. .word 0
  288. .word 30584
  289. .word 43703
  290. .word 43690
  291. .word 43690
  292. .word 16380
  293. .word 0
  294. .type _P1,@object
  295. .size _P1,24
  296. .align 2
  297. _KLN2:
  298. .word 61628
  299. .word 23575
  300. .word 15145
  301. .word 47274
  302. .word 16391
  303. .word 0
  304. .type _KLN2,@object
  305. .size _KLN2,12
  306. .align 2
  307. _TWO_63H:
  308. .word 0
  309. .word 0
  310. .word 0
  311. .word 49152
  312. .word 16446
  313. .word 0
  314. .type _TWO_63H,@object
  315. .size _TWO_63H,12
  316. .align 2
  317. _LN2K:
  318. .word 0
  319. .word 0
  320. .word 6134
  321. .word 45426
  322. .word 16374
  323. .word 0
  324. .word 55756
  325. .word 58609
  326. .word 48341
  327. .word 59623
  328. .word 16343
  329. .word 0
  330. .type _LN2K,@object
  331. .size _LN2K,24
  332. .align 2
  333. _P:
  334. .word 0
  335. .word 0
  336. .word 0
  337. .word 32768
  338. .word 16382
  339. .word 0
  340. .word 10558
  341. .word 43680
  342. .word 43690
  343. .word 43690
  344. .word 16380
  345. .word 0
  346. .word 59664
  347. .word 43680
  348. .word 43690
  349. .word 43690
  350. .word 16378
  351. .word 0
  352. .word 56450
  353. .word 15979
  354. .word 35652
  355. .word 34952
  356. .word 16376
  357. .word 0
  358. .word 7105
  359. .word 47411
  360. .word 25657
  361. .word 46603
  362. .word 16373
  363. .word 0
  364. .type _P,@object
  365. .size _P,60
  366. .align 2
  367. _inf_zeros:
  368. .word 0
  369. .word 0
  370. .word 0
  371. .word 32768
  372. .word 32767
  373. .word 0
  374. .word 0
  375. .word 0
  376. .word 0
  377. .word 0
  378. .word 0
  379. .word 0
  380. .type _inf_zeros,@object
  381. .size _inf_zeros,24
  382. .data
  383. .hidden __libm_expl_table_256
  384. .section .note.GNU-stack, ""
  385. # End