libm_expl_k80.S 9.2 KB

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