exp2l.S 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  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 "exp2l.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin exp2l
  41. .text
  42. .align 16,0x90
  43. .globl exp2l
  44. exp2l:
  45. # parameter 1: 96 + %rsp
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_exp2l.1:
  49. ..L2:
  50. subq $88, %rsp
  51. .cfi_def_cfa_offset 96
  52. xorb %r8b, %r8b
  53. ..B1.2:
  54. fnstcw 82(%rsp)
  55. ..B1.3:
  56. movb 105(%rsp), %cl
  57. lea _ranges(%rip), %rdx
  58. andb $-128, %cl
  59. shrb $7, %cl
  60. movzbl %cl, %edi
  61. movq %rdi, %rsi
  62. shlq $4, %rsi
  63. movzwl 104(%rsp), %ecx
  64. andl $32767, %ecx
  65. movzwl 8(%rsi,%rdx), %eax
  66. andl $32767, %eax
  67. cmpl %eax, %ecx
  68. jl ..B1.8
  69. ..B1.4:
  70. jne ..B1.39
  71. ..B1.5:
  72. movl 100(%rsp), %eax
  73. cmpl 4(%rsi,%rdx), %eax
  74. jb ..B1.8
  75. ..B1.6:
  76. jne ..B1.39
  77. ..B1.7:
  78. movl 96(%rsp), %eax
  79. cmpl (%rsi,%rdx), %eax
  80. jae ..B1.39
  81. ..B1.8:
  82. movzwl 82(%rsp), %edx
  83. cmpl $16369, %ecx
  84. jge ..B1.19
  85. ..B1.9:
  86. movl %edx, %eax
  87. andl $768, %eax
  88. cmpl $768, %eax
  89. je ..B1.13
  90. ..B1.10:
  91. orl $-64768, %edx
  92. movw %dx, 80(%rsp)
  93. ..B1.11:
  94. fldcw 80(%rsp)
  95. ..B1.12:
  96. movzwl 104(%rsp), %ecx
  97. movb $1, %r8b
  98. andl $32767, %ecx
  99. ..B1.13:
  100. fldt 96(%rsp)
  101. cmpl $16316, %ecx
  102. fstpt 16(%rsp)
  103. jge ..B1.15
  104. ..B1.14:
  105. fldt .L_2il0floatpacket.0(%rip)
  106. fldt 16(%rsp)
  107. faddp %st, %st(1)
  108. fstpt 16(%rsp)
  109. jmp ..B1.16
  110. ..B1.15:
  111. fldt 16(%rsp)
  112. lea 48+_P1(%rip), %rax
  113. fld %st(0)
  114. lea 32+_P1(%rip), %rcx
  115. lea 16+_P1(%rip), %rdx
  116. lea _P1(%rip), %rsi
  117. fmul %st(1), %st
  118. fldt (%rax)
  119. fmul %st(1), %st
  120. fldt (%rdx)
  121. faddp %st, %st(1)
  122. fmul %st(1), %st
  123. fldt (%rcx)
  124. fmulp %st, %st(2)
  125. fldt (%rsi)
  126. faddp %st, %st(2)
  127. fxch %st(2)
  128. fmulp %st, %st(1)
  129. faddp %st, %st(1)
  130. fldt .L_2il0floatpacket.0(%rip)
  131. faddp %st, %st(1)
  132. fstpt 16(%rsp)
  133. ..B1.16:
  134. testb %r8b, %r8b
  135. je ..B1.18
  136. ..B1.17:
  137. fldcw 82(%rsp)
  138. ..B1.18:
  139. fldt 16(%rsp)
  140. addq $88, %rsp
  141. .cfi_def_cfa_offset 8
  142. ret
  143. .cfi_def_cfa_offset 96
  144. ..B1.19:
  145. movl %edx, %eax
  146. andl $768, %eax
  147. cmpl $768, %eax
  148. je ..B1.23
  149. ..B1.20:
  150. orl $-64768, %edx
  151. movw %dx, 80(%rsp)
  152. ..B1.21:
  153. fldcw 80(%rsp)
  154. ..B1.22:
  155. movzwl 104(%rsp), %ecx
  156. movb $1, %r8b
  157. andl $32767, %ecx
  158. ..B1.23:
  159. fldt .L_2il0floatpacket.0(%rip)
  160. cmpl $16383, %ecx
  161. fstpt 64(%rsp)
  162. jl ..B1.30
  163. ..B1.24:
  164. fldt 96(%rsp)
  165. lea _TWO_63H(%rip), %rax
  166. cmpl $0, 96(%rsp)
  167. fldl (%rax)
  168. jne ..B1.31
  169. ..B1.25:
  170. negl %ecx
  171. movl $-1, %eax
  172. addl $30, %ecx
  173. shll %cl, %eax
  174. testl %eax, 100(%rsp)
  175. jne ..B1.31
  176. ..B1.26:
  177. fld %st(1)
  178. fadd %st(1), %st
  179. fstpt 48(%rsp)
  180. movl 48(%rsp), %eax
  181. cmpl $-16382, %eax
  182. jl ..B1.31
  183. ..B1.27:
  184. fstp %st(0)
  185. fstp %st(0)
  186. addl $16383, %eax
  187. movzwl 8+.L_2il0floatpacket.0(%rip), %edx
  188. andl $32767, %eax
  189. andl $-32768, %edx
  190. orl %eax, %edx
  191. movw %dx, 72(%rsp)
  192. testb %r8b, %r8b
  193. je ..B1.29
  194. ..B1.28:
  195. fldcw 82(%rsp)
  196. ..B1.29:
  197. fldt 64(%rsp)
  198. addq $88, %rsp
  199. .cfi_def_cfa_offset 8
  200. ret
  201. .cfi_def_cfa_offset 96
  202. ..B1.30:
  203. fldt 96(%rsp)
  204. lea _TWO_63H(%rip), %rax
  205. fldl (%rax)
  206. ..B1.31:
  207. fldt .L_2il0floatpacket.1(%rip)
  208. lea _TWO_48H(%rip), %rcx
  209. fmul %st(2), %st
  210. lea SC2_BIAS(%rip), %r9
  211. movzwl 72(%rsp), %r11d
  212. fadd %st(1), %st
  213. fstpt 48(%rsp)
  214. fldt 48(%rsp)
  215. andl $-32768, %r11d
  216. movl 48(%rsp), %edx
  217. fsubp %st, %st(1)
  218. fldt .L_2il0floatpacket.2(%rip)
  219. fmulp %st, %st(1)
  220. movsbq %dl, %rax
  221. fsubr %st(1), %st
  222. fldl (%rcx)
  223. movl %eax, %r10d
  224. fld %st(0)
  225. negl %r10d
  226. addl %edx, %r10d
  227. lea 48+_P(%rip), %rcx
  228. shrl $8, %r10d
  229. addl $4196735, %edx
  230. addl (%r9,%rdi,4), %r10d
  231. lea 80+_P(%rip), %rdi
  232. lea 64+_P(%rip), %r9
  233. andl $32767, %r10d
  234. orl %r10d, %r11d
  235. lea 32+_P(%rip), %r10
  236. movw %r11w, 72(%rsp)
  237. lea _P(%rip), %r11
  238. shlq $4, %rax
  239. fadd %st(2), %st
  240. fstpt 16(%rsp)
  241. fldt 16(%rsp)
  242. cmpl $3070, %edx
  243. fsubp %st, %st(1)
  244. fld %st(0)
  245. fxch %st(1)
  246. fsubr %st, %st(2)
  247. fxch %st(1)
  248. fadd %st(2), %st
  249. fld %st(0)
  250. fmul %st(1), %st
  251. fldt (%rdi)
  252. lea 16+_P(%rip), %rdi
  253. fmul %st(1), %st
  254. fldt (%rcx)
  255. lea 96+_P(%rip), %rcx
  256. faddp %st, %st(1)
  257. fmul %st(1), %st
  258. fldt (%rdi)
  259. movq __libm_expl_table_256@GOTPCREL(%rip), %rdi
  260. faddp %st, %st(1)
  261. fmul %st(1), %st
  262. fldt (%r9)
  263. fmul %st(2), %st
  264. fldt (%r10)
  265. faddp %st, %st(1)
  266. fmulp %st, %st(2)
  267. fldt (%r11)
  268. faddp %st, %st(2)
  269. fxch %st(2)
  270. fmulp %st, %st(1)
  271. faddp %st, %st(1)
  272. fldt (%rcx)
  273. fmul %st, %st(3)
  274. fxch %st(3)
  275. faddp %st, %st(1)
  276. fxch %st(2)
  277. fmulp %st, %st(1)
  278. fldl 2048(%rdi,%rax)
  279. fld %st(0)
  280. fmul %st(3), %st
  281. fxch %st(2)
  282. fadd %st, %st(3)
  283. fmul %st(1), %st
  284. faddp %st, %st(1)
  285. fxch %st(2)
  286. fmull 2056(%rdi,%rax)
  287. faddp %st, %st(1)
  288. faddl 2056(%rdi,%rax)
  289. ja ..B1.34
  290. ..B1.32:
  291. lea _exp2but(%rip), %rax
  292. fldt (%rax)
  293. fcomip %st(3), %st
  294. jbe ..B1.34
  295. ..B1.33:
  296. fstp %st(2)
  297. fld %st(0)
  298. lea _TWO_12H(%rip), %rax
  299. lea _SC2(%rip), %rdx
  300. fadd %st(2), %st
  301. fldl (%rax)
  302. fmul %st(1), %st
  303. fadd %st, %st(1)
  304. fxch %st(1)
  305. fstpt 16(%rsp)
  306. fldt 16(%rsp)
  307. fsubp %st, %st(1)
  308. fsubr %st, %st(1)
  309. fxch %st(1)
  310. faddp %st, %st(2)
  311. fldt (%rsi,%rdx)
  312. fldt 64(%rsp)
  313. fmul %st, %st(2)
  314. fxch %st(1)
  315. fmul %st, %st(2)
  316. fxch %st(1)
  317. fmulp %st, %st(3)
  318. fmulp %st, %st(2)
  319. faddp %st, %st(1)
  320. fstpt 32(%rsp)
  321. jmp ..B1.35
  322. ..B1.34:
  323. fstp %st(2)
  324. fldt 64(%rsp)
  325. fxch %st(2)
  326. faddp %st, %st(1)
  327. lea _SC2(%rip), %rax
  328. fmulp %st, %st(1)
  329. fldt (%rsi,%rax)
  330. fmulp %st, %st(1)
  331. fstpt 32(%rsp)
  332. ..B1.35:
  333. fldt 32(%rsp)
  334. lea _minnorm(%rip), %rax
  335. fldt (%rax)
  336. fcomip %st(1), %st
  337. fstp %st(0)
  338. ja ..B1.48
  339. ..B1.36:
  340. testb %r8b, %r8b
  341. je ..B1.38
  342. ..B1.37:
  343. fldt 16(%rsp)
  344. fstpt 48(%rsp)
  345. ..B1.58:
  346. fldcw 82(%rsp)
  347. ..B1.38:
  348. fldt 32(%rsp)
  349. addq $88, %rsp
  350. .cfi_def_cfa_offset 8
  351. ret
  352. .cfi_def_cfa_offset 96
  353. ..B1.39:
  354. movzwl 82(%rsp), %edx
  355. movl %edx, %eax
  356. andl $768, %eax
  357. cmpl $768, %eax
  358. je ..B1.43
  359. ..B1.40:
  360. orl $-64768, %edx
  361. movw %dx, 80(%rsp)
  362. ..B1.41:
  363. fldcw 80(%rsp)
  364. ..B1.42:
  365. movzwl 104(%rsp), %ecx
  366. movb $1, %r8b
  367. andl $32767, %ecx
  368. ..B1.43:
  369. cmpl $32767, %ecx
  370. je ..B1.49
  371. ..B1.44:
  372. testq %rdi, %rdi
  373. je ..B1.46
  374. ..B1.45:
  375. lea _small_value_80(%rip), %rax
  376. fldt (%rax)
  377. fmul %st(0), %st
  378. addq $88, %rsp
  379. .cfi_def_cfa_offset 8
  380. ret
  381. .cfi_def_cfa_offset 96
  382. ..B1.46:
  383. lea _large_value_80(%rip), %rax
  384. fldt (%rax)
  385. fmul %st(0), %st
  386. ..B1.47:
  387. addq $88, %rsp
  388. .cfi_def_cfa_offset 8
  389. ret
  390. .cfi_def_cfa_offset 96
  391. ..B1.48:
  392. lea _small_value_80(%rip), %rax
  393. fldt (%rax)
  394. fmul %st(0), %st
  395. fstpt (%rsp)
  396. jmp ..B1.36
  397. ..B1.49:
  398. cmpl $-2147483648, 100(%rsp)
  399. jne ..B1.52
  400. ..B1.50:
  401. cmpl $0, 96(%rsp)
  402. jne ..B1.52
  403. ..B1.51:
  404. lea _inf_zeros(%rip), %rax
  405. fldl (%rax,%rdi,8)
  406. fstpt 16(%rsp)
  407. jmp ..B1.53
  408. ..B1.52:
  409. fldt 96(%rsp)
  410. fstpt 16(%rsp)
  411. ..B1.53:
  412. testb %r8b, %r8b
  413. je ..B1.55
  414. ..B1.54:
  415. fldcw 82(%rsp)
  416. ..B1.55:
  417. fldt 16(%rsp)
  418. addq $88, %rsp
  419. .cfi_def_cfa_offset 8
  420. ret
  421. .align 16,0x90
  422. .cfi_endproc
  423. .type exp2l,@function
  424. .size exp2l,.-exp2l
  425. .data
  426. # -- End exp2l
  427. .section .rodata, "a"
  428. .align 16
  429. .align 16
  430. .L_2il0floatpacket.0:
  431. .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00
  432. .type .L_2il0floatpacket.0,@object
  433. .size .L_2il0floatpacket.0,16
  434. .align 16
  435. .L_2il0floatpacket.1:
  436. .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x07,0x40,0x00,0x00,0x00,0x00,0x00,0x00
  437. .type .L_2il0floatpacket.1,@object
  438. .size .L_2il0floatpacket.1,16
  439. .align 16
  440. .L_2il0floatpacket.2:
  441. .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xf7,0x3f,0x00,0x00,0x00,0x00,0x00,0x00
  442. .type .L_2il0floatpacket.2,@object
  443. .size .L_2il0floatpacket.2,16
  444. .align 4
  445. _TWO_63H:
  446. .long 0
  447. .long 1139277824
  448. .type _TWO_63H,@object
  449. .size _TWO_63H,8
  450. .align 4
  451. _TWO_48H:
  452. .long 0
  453. .long 1123549184
  454. .type _TWO_48H,@object
  455. .size _TWO_48H,8
  456. .align 4
  457. SC2_BIAS:
  458. .long 8191
  459. .long 24575
  460. .type SC2_BIAS,@object
  461. .size SC2_BIAS,8
  462. .align 4
  463. _TWO_12H:
  464. .long 0
  465. .long 1085800448
  466. .type _TWO_12H,@object
  467. .size _TWO_12H,8
  468. .align 4
  469. _inf_zeros:
  470. .long 0
  471. .long 2146435072
  472. .long 0
  473. .long 0
  474. .type _inf_zeros,@object
  475. .size _inf_zeros,16
  476. .align 2
  477. _ranges:
  478. .word 0
  479. .word 0
  480. .word 0
  481. .word 32768
  482. .word 16397
  483. .word 0
  484. .word 0
  485. .word 0
  486. .word 65535
  487. .word 65535
  488. .word 65535
  489. .word 32894
  490. .word 16397
  491. .word 0
  492. .word 0
  493. .word 0
  494. .type _ranges,@object
  495. .size _ranges,32
  496. .align 2
  497. _P1:
  498. .word 31148
  499. .word 53711
  500. .word 6135
  501. .word 45426
  502. .word 16382
  503. .word 0
  504. .word 0
  505. .word 0
  506. .word 30019
  507. .word 5676
  508. .word 61436
  509. .word 62973
  510. .word 16380
  511. .word 0
  512. .word 0
  513. .word 0
  514. .word 31705
  515. .word 37440
  516. .word 18104
  517. .word 58200
  518. .word 16378
  519. .word 0
  520. .word 0
  521. .word 0
  522. .word 59309
  523. .word 6415
  524. .word 23422
  525. .word 40341
  526. .word 16376
  527. .word 0
  528. .word 0
  529. .word 0
  530. .type _P1,@object
  531. .size _P1,64
  532. .align 2
  533. _P:
  534. .word 12039
  535. .word 52575
  536. .word 36475
  537. .word 49086
  538. .word 16363
  539. .word 0
  540. .word 0
  541. .word 0
  542. .word 30020
  543. .word 5676
  544. .word 61436
  545. .word 62973
  546. .word 16380
  547. .word 0
  548. .word 0
  549. .word 0
  550. .word 64966
  551. .word 9463
  552. .word 18104
  553. .word 58200
  554. .word 16378
  555. .word 0
  556. .word 0
  557. .word 0
  558. .word 46891
  559. .word 53866
  560. .word 23421
  561. .word 40341
  562. .word 16376
  563. .word 0
  564. .word 0
  565. .word 0
  566. .word 12114
  567. .word 63546
  568. .word 699
  569. .word 44740
  570. .word 16373
  571. .word 0
  572. .word 0
  573. .word 0
  574. .word 63250
  575. .word 29232
  576. .word 35994
  577. .word 41348
  578. .word 16370
  579. .word 0
  580. .word 0
  581. .word 0
  582. .word 0
  583. .word 0
  584. .word 0
  585. .word 45426
  586. .word 16382
  587. .word 0
  588. .word 0
  589. .word 0
  590. .type _P,@object
  591. .size _P,112
  592. .align 2
  593. _exp2but:
  594. .word 0
  595. .word 0
  596. .word 0
  597. .word 65528
  598. .word 49164
  599. .word 0
  600. .word 0
  601. .word 0
  602. .type _exp2but,@object
  603. .size _exp2but,16
  604. .align 2
  605. _SC2:
  606. .word 0
  607. .word 0
  608. .word 0
  609. .word 32768
  610. .word 24575
  611. .word 0
  612. .word 0
  613. .word 0
  614. .word 0
  615. .word 0
  616. .word 0
  617. .word 32768
  618. .word 8191
  619. .word 0
  620. .word 0
  621. .word 0
  622. .type _SC2,@object
  623. .size _SC2,32
  624. .align 2
  625. _minnorm:
  626. .word 0
  627. .word 0
  628. .word 0
  629. .word 32768
  630. .word 1
  631. .word 0
  632. .word 0
  633. .word 0
  634. .type _minnorm,@object
  635. .size _minnorm,16
  636. .align 2
  637. _small_value_80:
  638. .word 0
  639. .word 0
  640. .word 0
  641. .word 32768
  642. .word 6383
  643. .word 0
  644. .word 0
  645. .word 0
  646. .word 0
  647. .word 0
  648. .word 0
  649. .word 32768
  650. .word 39151
  651. .word 0
  652. .word 0
  653. .word 0
  654. .type _small_value_80,@object
  655. .size _small_value_80,32
  656. .align 2
  657. _large_value_80:
  658. .word 0
  659. .word 0
  660. .word 0
  661. .word 32768
  662. .word 26383
  663. .word 0
  664. .word 0
  665. .word 0
  666. .word 0
  667. .word 0
  668. .word 0
  669. .word 32768
  670. .word 59151
  671. .word 0
  672. .word 0
  673. .word 0
  674. .type _large_value_80,@object
  675. .size _large_value_80,32
  676. .data
  677. .section .note.GNU-stack, ""
  678. // -- Begin DWARF2 SEGMENT .eh_frame
  679. .section .eh_frame,"a",@progbits
  680. .eh_frame_seg:
  681. .align 1
  682. # End