cexpl.S 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  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 "cexpl.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin cexpl
  41. .text
  42. .align 16,0x90
  43. .globl cexpl
  44. cexpl:
  45. # parameter 1: 12 + %ebp
  46. ..B1.1:
  47. ..L1:
  48. pushl %ebp
  49. movl %esp, %ebp
  50. andl $-64, %esp
  51. pushl %esi
  52. pushl %edi
  53. pushl %ebx
  54. subl $244, %esp
  55. call ..L2
  56. ..L2:
  57. popl %ebx
  58. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%ebx), %ebx
  59. movl %gs:20, %edx
  60. movl 8(%ebp), %esi
  61. xorl %esp, %edx
  62. fldt .L_2il0floatpacket.7@GOTOFF(%ebx)
  63. movl %edx, 228(%esp)
  64. fstpt 96(%esp)
  65. fldt 96(%esp)
  66. fstpt 204(%esp)
  67. fldt 204(%esp)
  68. fstpt 216(%esp)
  69. ..B1.2:
  70. fnstcw 46(%esp)
  71. ..B1.3:
  72. movzwl 46(%esp), %ecx
  73. movl %ecx, %edx
  74. andl $768, %edx
  75. cmpl $768, %edx
  76. je ..B1.61
  77. ..B1.4:
  78. orl $-64768, %ecx
  79. movw %cx, 44(%esp)
  80. ..B1.5:
  81. fldcw 44(%esp)
  82. ..B1.6:
  83. movl $1, %edi
  84. ..B1.7:
  85. movzwl 20(%ebp), %edx
  86. andl $32767, %edx
  87. cmpl $32767, %edx
  88. jge ..B1.31
  89. ..B1.8:
  90. testl %edx, %edx
  91. jle ..B1.54
  92. ..B1.9:
  93. movzwl 32(%ebp), %ecx
  94. andl $32767, %ecx
  95. cmpl $32767, %ecx
  96. jge ..B1.31
  97. ..B1.10:
  98. testl %ecx, %ecx
  99. jle ..B1.52
  100. ..B1.11:
  101. fldt 12(%ebp)
  102. lea 180(%esp), %ecx
  103. fstpt (%ecx)
  104. fldt -84(%ecx)
  105. fstpt 12(%ecx)
  106. addl $-16, %esp
  107. lea 172(%esp), %edx
  108. movl %edx, (%esp)
  109. movl %ecx, 4(%esp)
  110. call __libm_expl_k80
  111. ..B1.64:
  112. fstpt 96(%esp)
  113. addl $16, %esp
  114. ..B1.12:
  115. movzwl 164(%esp), %edx
  116. andl $32767, %edx
  117. cmpl $32767, %edx
  118. je ..B1.51
  119. ..B1.13:
  120. testl %edx, %edx
  121. je ..B1.22
  122. ..B1.14:
  123. fldt 36+_CONSTANTS@GOTOFF(%ebx)
  124. fldt 80(%esp)
  125. faddp %st, %st(1)
  126. fstpt (%esp)
  127. fldt 156(%esp)
  128. fld %st(0)
  129. fldt 168(%esp)
  130. movl (%esp), %edx
  131. fadd %st, %st(1)
  132. fld %st(1)
  133. fxch %st(2)
  134. fsub %st, %st(3)
  135. movl %edx, 28(%esp)
  136. fxch %st(3)
  137. fsubrp %st, %st(1)
  138. fldt .L_2il0floatpacket.8@GOTOFF(%ebx)
  139. fmul %st, %st(2)
  140. fld %st(2)
  141. fsub %st(4), %st
  142. fsubrp %st, %st(3)
  143. fxch %st(2)
  144. fstpt 32(%esp)
  145. fldt 32(%esp)
  146. addl $-16, %esp
  147. fsubrp %st, %st(3)
  148. faddp %st, %st(2)
  149. fldt 24(%ebp)
  150. fstpt (%esp)
  151. lea 148(%esp), %ecx
  152. movl %ecx, 12(%esp)
  153. fstpt -84(%ecx)
  154. fstpt -68(%ecx)
  155. call __libm_cosl_k80
  156. ..B1.65:
  157. fldt 80(%esp)
  158. fldt 64(%esp)
  159. addl $16, %esp
  160. ..B1.15:
  161. fldt 132(%esp)
  162. fld %st(0)
  163. fldt 144(%esp)
  164. movzwl 32(%ebp), %edx
  165. fadd %st, %st(1)
  166. andl $32767, %edx
  167. fxch %st(1)
  168. fsub %st, %st(2)
  169. cmpl $16183, %edx
  170. fxch %st(2)
  171. fsubrp %st, %st(1)
  172. fld %st(2)
  173. fmul %st(2), %st
  174. fld %st(0)
  175. fsub %st(3), %st
  176. fsubrp %st, %st(1)
  177. fsubr %st, %st(2)
  178. fxch %st(1)
  179. faddp %st, %st(2)
  180. fmul %st(4), %st
  181. fxch %st(1)
  182. fmulp %st, %st(4)
  183. fldt 12+_CONSTANTS@GOTOFF(%ebx)
  184. faddp %st, %st(1)
  185. jge ..B1.17
  186. ..B1.16:
  187. fldt 24(%ebp)
  188. fldt 24+_CONSTANTS@GOTOFF(%ebx)
  189. fmulp %st, %st(1)
  190. fstpt 108(%esp)
  191. fldt 96(%esp)
  192. movzwl 116(%esp), %ecx
  193. movl %ecx, %edx
  194. andl $-32768, %ecx
  195. andl $32767, %edx
  196. orl $-49153, %ecx
  197. addl $-16639, %edx
  198. movw %cx, 116(%esp)
  199. fstpt 120(%esp)
  200. fldt 108(%esp)
  201. movl %edx, 12(%esp)
  202. jmp ..B1.19
  203. ..B1.17:
  204. fldt 24(%ebp)
  205. addl $-16, %esp
  206. lea 124(%esp), %edx
  207. fstpt (%esp)
  208. movl %edx, 12(%esp)
  209. fxch %st(3)
  210. fstpt 16(%esp)
  211. fxch %st(2)
  212. fstpt -92(%edx)
  213. fxch %st(1)
  214. fstpt -60(%edx)
  215. fstpt -44(%edx)
  216. call __libm_sinl_k80
  217. ..B1.66:
  218. fldt 80(%esp)
  219. fldt 64(%esp)
  220. fldt 32(%esp)
  221. fldt 16(%esp)
  222. addl $16, %esp
  223. ..B1.18:
  224. fldt 108(%esp)
  225. fmul %st(5), %st
  226. fstpt 108(%esp)
  227. fldt 108(%esp)
  228. fldt 120(%esp)
  229. fmulp %st, %st(6)
  230. fxch %st(5)
  231. fstpt 96(%esp)
  232. fldt 96(%esp)
  233. fstpt 120(%esp)
  234. movl $0, 12(%esp)
  235. fxch %st(4)
  236. ..B1.19:
  237. fldt 96(%esp)
  238. fld %st(1)
  239. fadd %st(1), %st
  240. fmul %st, %st(4)
  241. fsub %st, %st(2)
  242. fxch %st(2)
  243. fsubrp %st, %st(1)
  244. fld %st(3)
  245. fsub %st(2), %st
  246. fsubrp %st, %st(4)
  247. fxch %st(1)
  248. fsub %st(3), %st
  249. faddp %st, %st(1)
  250. fld %st(3)
  251. fmul %st(5), %st
  252. fldt 32(%esp)
  253. addl $-32, %esp
  254. fmul %st, %st(6)
  255. fxch %st(6)
  256. faddp %st, %st(1)
  257. fxch %st(2)
  258. fmul %st, %st(5)
  259. fxch %st(5)
  260. fstpt (%esp)
  261. fxch %st(3)
  262. fmul %st, %st(4)
  263. fxch %st(4)
  264. faddp %st, %st(1)
  265. fstpt 12(%esp)
  266. movl 60(%esp), %edx
  267. movl %edx, 24(%esp)
  268. fxch %st(1)
  269. fstpt 32(%esp)
  270. fstpt 80(%esp)
  271. fstpt 96(%esp)
  272. call __libm_scalbl_k80
  273. ..B1.67:
  274. fldt 96(%esp)
  275. fldt 80(%esp)
  276. fldt 32(%esp)
  277. addl $32, %esp
  278. ..B1.20:
  279. fxch %st(3)
  280. fstpt 204(%esp)
  281. fld %st(1)
  282. fmul %st(3), %st
  283. fxch %st(1)
  284. fmul %st, %st(2)
  285. fldt 32(%esp)
  286. addl $-32, %esp
  287. fld %st(0)
  288. fmulp %st, %st(2)
  289. fxch %st(1)
  290. fstpt (%esp)
  291. fmulp %st, %st(3)
  292. faddp %st, %st(2)
  293. faddp %st, %st(1)
  294. fstpt 12(%esp)
  295. movl 60(%esp), %edx
  296. addl 44(%esp), %edx
  297. movl %edx, 24(%esp)
  298. call __libm_scalbl_k80
  299. ..B1.68:
  300. addl $32, %esp
  301. ..B1.21:
  302. fstpt 216(%esp)
  303. jmp ..B1.46
  304. ..B1.22:
  305. fldt 12+_CONSTANTS@GOTOFF(%ebx)
  306. fmul %st(0), %st
  307. fstpt 16(%esp)
  308. ..B1.23:
  309. fldt 16(%esp)
  310. fstpt 156(%esp)
  311. fldt 24(%ebp)
  312. fstpt (%esp)
  313. fldt (%esp)
  314. addl $-16, %esp
  315. fstpt (%esp)
  316. call cosl@PLT
  317. ..B1.69:
  318. addl $16, %esp
  319. fldt 16(%esp)
  320. fmulp %st, %st(1)
  321. movzwl 32(%ebp), %edx
  322. testl $32767, %edx
  323. fstpt 204(%esp)
  324. jle ..B1.25
  325. ..B1.24:
  326. addl $-16, %esp
  327. fldt 16(%esp)
  328. fstpt (%esp)
  329. call sinl@PLT
  330. ..B1.70:
  331. addl $16, %esp
  332. fldt 16(%esp)
  333. fmulp %st, %st(1)
  334. fstpt 216(%esp)
  335. jmp ..B1.26
  336. ..B1.25:
  337. fldt (%esp)
  338. fldt 16(%esp)
  339. fmulp %st, %st(1)
  340. fstpt 216(%esp)
  341. ..B1.26:
  342. testl %edi, %edi
  343. je ..B1.28
  344. ..B1.27:
  345. fldt 80(%esp)
  346. fstpt (%esp)
  347. ..B1.71:
  348. fldcw 46(%esp)
  349. ..B1.28:
  350. movl 204(%esp), %edx
  351. movl %edx, (%esi)
  352. movl 216(%esp), %edx
  353. movl %edx, 12(%esi)
  354. movl 220(%esp), %edx
  355. movl %edx, 16(%esi)
  356. movl 208(%esp), %ecx
  357. movl 212(%esp), %edi
  358. movl 224(%esp), %edx
  359. movl %ecx, 4(%esi)
  360. movl %edi, 8(%esi)
  361. movl %edx, 20(%esi)
  362. movl 228(%esp), %edx
  363. xorl %esp, %edx
  364. cmpl %gs:20, %edx
  365. jne ..B1.50
  366. ..B1.29:
  367. movl %esi, %eax
  368. addl $244, %esp
  369. popl %ebx
  370. popl %edi
  371. popl %esi
  372. movl %ebp, %esp
  373. popl %ebp
  374. ret $4
  375. ..B1.31:
  376. movl 28(%ebp), %ecx
  377. ..B1.32:
  378. testl %ecx, %ecx
  379. jne ..B1.35
  380. ..B1.79:
  381. cmpl $0, 24(%ebp)
  382. ..B1.33:
  383. jne ..B1.35
  384. ..B1.34:
  385. fldt 12(%ebp)
  386. addl $-16, %esp
  387. fstpt (%esp)
  388. call expl@PLT
  389. ..B1.72:
  390. fldt 24(%ebp)
  391. addl $16, %esp
  392. fstpt 216(%esp)
  393. fstpt 204(%esp)
  394. jmp ..B1.46
  395. ..B1.35:
  396. movzwl 32(%ebp), %ecx
  397. andl $32767, %ecx
  398. movl %ecx, 12(%esp)
  399. cmpl $32767, %ecx
  400. jge ..B1.38
  401. ..B1.36:
  402. fldt 12(%ebp)
  403. addl $-16, %esp
  404. fstpt (%esp)
  405. call expl@PLT
  406. ..B1.74:
  407. fldt 24(%ebp)
  408. fxch %st(1)
  409. fstpt 16(%esp)
  410. fstpt (%esp)
  411. fldt (%esp)
  412. fstpt 32(%esp)
  413. call cosl@PLT
  414. ..B1.73:
  415. fldt 32(%esp)
  416. addl $16, %esp
  417. fldt (%esp)
  418. fmulp %st, %st(2)
  419. fxch %st(1)
  420. fstpt 204(%esp)
  421. cmpl $0, 12(%esp)
  422. jle ..B1.57
  423. ..B1.37:
  424. addl $-16, %esp
  425. fstpt (%esp)
  426. call sinl@PLT
  427. ..B1.75:
  428. addl $16, %esp
  429. fldt (%esp)
  430. fmulp %st, %st(1)
  431. fstpt 216(%esp)
  432. jmp ..B1.46
  433. ..B1.38:
  434. cmpl $32767, %edx
  435. jge ..B1.40
  436. ..B1.39:
  437. fldt 24(%ebp)
  438. addl $-16, %esp
  439. fstpt (%esp)
  440. call sinl@PLT
  441. ..B1.76:
  442. addl $16, %esp
  443. fstpt 204(%esp)
  444. fldt 204(%esp)
  445. fstpt 216(%esp)
  446. jmp ..B1.46
  447. ..B1.40:
  448. cmpl $-2147483648, 16(%ebp)
  449. jne ..B1.42
  450. ..B1.41:
  451. cmpl $0, 12(%ebp)
  452. je ..B1.43
  453. ..B1.42:
  454. fldt 12(%ebp)
  455. fmul %st(0), %st
  456. fstpt 204(%esp)
  457. fldt 204(%esp)
  458. fldt 24(%ebp)
  459. fmulp %st, %st(1)
  460. fstpt 216(%esp)
  461. jmp ..B1.46
  462. ..B1.43:
  463. movzbl 21(%ebp), %edx
  464. testl $128, %edx
  465. je ..B1.45
  466. ..B1.44:
  467. fldt 24(%ebp)
  468. fmul %st(0), %st
  469. fstpt 24(%ebp)
  470. fldt 96(%esp)
  471. fstpt 204(%esp)
  472. fldt 204(%esp)
  473. fstpt 216(%esp)
  474. jmp ..B1.46
  475. ..B1.45:
  476. fldt 12(%ebp)
  477. addl $-16, %esp
  478. fstpt (%esp)
  479. call expl@PLT
  480. ..B1.78:
  481. fldt 24(%ebp)
  482. addl $16, %esp
  483. fxch %st(1)
  484. fstpt 204(%esp)
  485. addl $-16, %esp
  486. fstpt (%esp)
  487. call sinl@PLT
  488. ..B1.77:
  489. addl $16, %esp
  490. fstpt 216(%esp)
  491. ..B1.46:
  492. testl %edi, %edi
  493. je ..B1.48
  494. ..B1.47:
  495. fldcw 46(%esp)
  496. ..B1.48:
  497. movl 204(%esp), %edx
  498. movl %edx, (%esi)
  499. movl 216(%esp), %edx
  500. movl %edx, 12(%esi)
  501. movl 220(%esp), %edx
  502. movl %edx, 16(%esi)
  503. movl 208(%esp), %ecx
  504. movl 212(%esp), %edi
  505. movl 224(%esp), %edx
  506. movl %ecx, 4(%esi)
  507. movl %edi, 8(%esi)
  508. movl %edx, 20(%esi)
  509. movl 228(%esp), %edx
  510. xorl %esp, %edx
  511. cmpl %gs:20, %edx
  512. jne ..B1.50
  513. ..B1.49:
  514. movl %esi, %eax
  515. addl $244, %esp
  516. popl %ebx
  517. popl %edi
  518. popl %esi
  519. movl %ebp, %esp
  520. popl %ebp
  521. ret $4
  522. ..B1.50:
  523. call __stack_chk_fail@PLT
  524. ..B1.51:
  525. fldt _CONSTANTS@GOTOFF(%ebx)
  526. fmul %st(0), %st
  527. fstpt 16(%esp)
  528. jmp ..B1.23
  529. ..B1.52:
  530. cmpl $0, 28(%ebp)
  531. jne ..B1.11
  532. ..B1.53:
  533. cmpl $0, 24(%ebp)
  534. jne ..B1.11
  535. jmp ..B1.33
  536. ..B1.54:
  537. cmpl $0, 16(%ebp)
  538. jne ..B1.9
  539. ..B1.55:
  540. cmpl $0, 12(%ebp)
  541. jne ..B1.9
  542. jmp ..B1.31
  543. ..B1.57:
  544. cmpl $0, 16(%ebp)
  545. jne ..B1.59
  546. ..B1.58:
  547. cmpl $0, 12(%ebp)
  548. je ..B1.37
  549. ..B1.59:
  550. fldt (%esp)
  551. fmulp %st, %st(1)
  552. fstpt 216(%esp)
  553. jmp ..B1.46
  554. ..B1.61:
  555. xorl %edi, %edi
  556. jmp ..B1.7
  557. .align 16,0x90
  558. .type cexpl,@function
  559. .size cexpl,.-cexpl
  560. .data
  561. # -- End cexpl
  562. .section .rodata, "a"
  563. .align 16
  564. .align 16
  565. .L_2il0floatpacket.7:
  566. .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
  567. .type .L_2il0floatpacket.7,@object
  568. .size .L_2il0floatpacket.7,12
  569. .space 4, 0x00 # pad
  570. .align 16
  571. .L_2il0floatpacket.8:
  572. .byte 0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x80,0x20,0x40,0x00,0x00
  573. .type .L_2il0floatpacket.8,@object
  574. .size .L_2il0floatpacket.8,12
  575. .space 4, 0x00 # pad
  576. .align 16
  577. _CONSTANTS:
  578. .word 0
  579. .word 0
  580. .word 0
  581. .word 32768
  582. .word 32766
  583. .word 0
  584. .word 0
  585. .word 0
  586. .word 0
  587. .word 32768
  588. .word 1
  589. .word 0
  590. .word 0
  591. .word 0
  592. .word 0
  593. .word 32768
  594. .word 16639
  595. .word 0
  596. .word 0
  597. .word 0
  598. .word 0
  599. .word 49152
  600. .word 16446
  601. .word 0
  602. .type _CONSTANTS,@object
  603. .size _CONSTANTS,48
  604. .data
  605. .hidden __libm_cosl_k80
  606. .hidden __libm_sinl_k80
  607. .hidden __libm_expl_k80
  608. .hidden __libm_scalbl_k80
  609. .section .note.GNU-stack, ""
  610. # End