exp2_gen.S 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  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 "exp2_gen.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin exp2
  41. .text
  42. .align 16,0x90
  43. .globl exp2
  44. exp2:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_exp2.1:
  49. ..L2:
  50. subq $56, %rsp
  51. .cfi_def_cfa_offset 64
  52. xorb %sil, %sil
  53. movsd %xmm0, 40(%rsp)
  54. ..B1.2:
  55. fnstcw 34(%rsp)
  56. ..B1.3:
  57. movl 44(%rsp), %edx
  58. movl %edx, %eax
  59. andl $2147483647, %eax
  60. lea -1072693248(%rax), %ecx
  61. cmpl $10483712, %ecx
  62. ja ..B1.9
  63. ..B1.4:
  64. movl %eax, %ecx
  65. movl $1048575, %edi
  66. shrl $20, %ecx
  67. incl %ecx
  68. shrl %cl, %edi
  69. andl %eax, %edi
  70. orl 40(%rsp), %edi
  71. jne ..B1.9
  72. ..B1.5:
  73. lea _TWO_52H(%rip), %rcx
  74. movsd 40(%rsp), %xmm0
  75. addsd (%rcx), %xmm0
  76. movsd %xmm0, 16(%rsp)
  77. movl 16(%rsp), %ecx
  78. cmpl $-1074, %ecx
  79. jl ..B1.9
  80. ..B1.6:
  81. lea 1023(%rcx), %eax
  82. testl %eax, %eax
  83. jle ..B1.37
  84. ..B1.7:
  85. movslq %eax, %rax
  86. shlq $52, %rax
  87. movq %rax, 8(%rsp)
  88. ..B1.8:
  89. movsd 8(%rsp), %xmm0
  90. addq $56, %rsp
  91. .cfi_def_cfa_offset 8
  92. ret
  93. .cfi_def_cfa_offset 64
  94. ..B1.9:
  95. cmpl $1079984128, %eax
  96. jae ..B1.14
  97. ..B1.10:
  98. cmpl $1012924416, %eax
  99. jae ..B1.12
  100. ..B1.11:
  101. movsd .L_2il0floatpacket.11(%rip), %xmm0
  102. addsd 40(%rsp), %xmm0
  103. addq $56, %rsp
  104. .cfi_def_cfa_offset 8
  105. ret
  106. .cfi_def_cfa_offset 64
  107. ..B1.12:
  108. movsd 40(%rsp), %xmm0
  109. pxor %xmm13, %xmm13
  110. lea _TWO_52H(%rip), %rax
  111. lea _two_32p1(%rip), %rdx
  112. movsd .L_2il0floatpacket.4(%rip), %xmm9
  113. lea _two_32(%rip), %rcx
  114. movsd .L_2il0floatpacket.7(%rip), %xmm10
  115. movsd .L_2il0floatpacket.2(%rip), %xmm4
  116. movsd (%rax), %xmm1
  117. mulsd .L_2il0floatpacket.0(%rip), %xmm0
  118. movsd (%rdx), %xmm2
  119. addsd %xmm1, %xmm0
  120. movsd %xmm0, 16(%rsp)
  121. movsd 16(%rsp), %xmm8
  122. movl 16(%rsp), %esi
  123. movl %esi, %edi
  124. movsd .L_2il0floatpacket.3(%rip), %xmm3
  125. subsd %xmm1, %xmm8
  126. mulsd .L_2il0floatpacket.1(%rip), %xmm8
  127. shll $25, %edi
  128. addsd 40(%rsp), %xmm8
  129. movaps %xmm8, %xmm7
  130. movaps %xmm8, %xmm5
  131. mulsd %xmm8, %xmm7
  132. mulsd %xmm7, %xmm9
  133. mulsd %xmm7, %xmm10
  134. addsd .L_2il0floatpacket.5(%rip), %xmm9
  135. addsd .L_2il0floatpacket.8(%rip), %xmm10
  136. mulsd %xmm7, %xmm9
  137. mulsd %xmm7, %xmm10
  138. addsd .L_2il0floatpacket.6(%rip), %xmm9
  139. addsd .L_2il0floatpacket.9(%rip), %xmm10
  140. mulsd %xmm7, %xmm9
  141. mulsd %xmm7, %xmm10
  142. movsd %xmm8, (%rsp)
  143. movl $0, (%rsp)
  144. movsd (%rsp), %xmm6
  145. sarl $25, %edi
  146. subsd %xmm6, %xmm5
  147. mulsd %xmm4, %xmm6
  148. addsd .L_2il0floatpacket.10(%rip), %xmm10
  149. mulsd %xmm4, %xmm5
  150. addsd %xmm6, %xmm2
  151. mulsd %xmm8, %xmm10
  152. addsd %xmm5, %xmm9
  153. movsd %xmm2, 16(%rsp)
  154. subl %edi, %esi
  155. movsd 16(%rsp), %xmm11
  156. movslq %edi, %rdi
  157. subsd (%rcx), %xmm11
  158. shlq $4, %rdi
  159. addsd %xmm11, %xmm3
  160. movq __libm_exp_table_128@GOTPCREL(%rip), %r8
  161. subsd %xmm3, %xmm6
  162. movsd 1032(%r8,%rdi), %xmm12
  163. addsd %xmm6, %xmm9
  164. movaps %xmm12, %xmm0
  165. addsd %xmm9, %xmm10
  166. mulsd %xmm11, %xmm12
  167. mulsd %xmm10, %xmm0
  168. addsd %xmm11, %xmm10
  169. mulsd 1024(%r8,%rdi), %xmm10
  170. shrl $7, %esi
  171. addsd %xmm10, %xmm0
  172. shll $23, %esi
  173. addsd %xmm12, %xmm0
  174. addl $1065353216, %esi
  175. movl %esi, 24(%rsp)
  176. cvtss2sd 24(%rsp), %xmm13
  177. mulsd %xmm13, %xmm0
  178. movsd %xmm11, (%rsp)
  179. movsd %xmm0, 8(%rsp)
  180. ..B1.13:
  181. addq $56, %rsp
  182. .cfi_def_cfa_offset 8
  183. ret
  184. .cfi_def_cfa_offset 64
  185. ..B1.14:
  186. lea _range(%rip), %r8
  187. movl %edx, %ecx
  188. shrl $31, %ecx
  189. cmpl 4(%r8,%rcx,8), %eax
  190. jb ..B1.17
  191. ..B1.15:
  192. jne ..B1.28
  193. ..B1.16:
  194. movl 40(%rsp), %edi
  195. cmpl (%r8,%rcx,8), %edi
  196. ja ..B1.28
  197. ..B1.17:
  198. movsd 40(%rsp), %xmm0
  199. lea _TWO_52H(%rip), %rdi
  200. mulsd .L_2il0floatpacket.0(%rip), %xmm0
  201. lea _two_32p1(%rip), %r9
  202. movsd (%rdi), %xmm1
  203. lea _two_32(%rip), %r10
  204. movsd .L_2il0floatpacket.4(%rip), %xmm9
  205. lea SC2_BIAS(%rip), %r11
  206. movsd .L_2il0floatpacket.2(%rip), %xmm4
  207. addsd %xmm1, %xmm0
  208. movsd %xmm0, 16(%rsp)
  209. movsd 16(%rsp), %xmm8
  210. movsd (%r9), %xmm2
  211. subsd %xmm1, %xmm8
  212. mulsd .L_2il0floatpacket.1(%rip), %xmm8
  213. movsd .L_2il0floatpacket.7(%rip), %xmm1
  214. movl 16(%rsp), %edx
  215. movl %edx, %eax
  216. movsd .L_2il0floatpacket.3(%rip), %xmm3
  217. movl %edx, %r8d
  218. shll $25, %eax
  219. addsd 40(%rsp), %xmm8
  220. movaps %xmm8, %xmm7
  221. movaps %xmm8, %xmm5
  222. mulsd %xmm8, %xmm7
  223. mulsd %xmm7, %xmm9
  224. mulsd %xmm7, %xmm1
  225. addsd .L_2il0floatpacket.5(%rip), %xmm9
  226. addsd .L_2il0floatpacket.8(%rip), %xmm1
  227. mulsd %xmm7, %xmm9
  228. mulsd %xmm7, %xmm1
  229. addsd .L_2il0floatpacket.6(%rip), %xmm9
  230. addsd .L_2il0floatpacket.9(%rip), %xmm1
  231. mulsd %xmm7, %xmm9
  232. mulsd %xmm7, %xmm1
  233. movsd %xmm8, (%rsp)
  234. movl $0, (%rsp)
  235. movsd (%rsp), %xmm6
  236. sarl $25, %eax
  237. subsd %xmm6, %xmm5
  238. mulsd %xmm4, %xmm6
  239. addsd .L_2il0floatpacket.10(%rip), %xmm1
  240. mulsd %xmm4, %xmm5
  241. addsd %xmm6, %xmm2
  242. mulsd %xmm8, %xmm1
  243. addsd %xmm5, %xmm9
  244. movsd %xmm2, 16(%rsp)
  245. subl %eax, %r8d
  246. movsd 16(%rsp), %xmm11
  247. movsd %xmm6, (%rsp)
  248. movslq %eax, %rax
  249. subsd (%r10), %xmm11
  250. shlq $4, %rax
  251. addsd %xmm11, %xmm3
  252. movq __libm_exp_table_128@GOTPCREL(%rip), %r9
  253. subsd %xmm3, %xmm6
  254. movsd 1032(%r9,%rax), %xmm2
  255. addsd %xmm6, %xmm9
  256. shrl $7, %r8d
  257. addsd %xmm9, %xmm1
  258. movaps %xmm1, %xmm10
  259. mulsd %xmm2, %xmm1
  260. addsd %xmm11, %xmm10
  261. mulsd %xmm11, %xmm2
  262. mulsd 1024(%r9,%rax), %xmm10
  263. movslq (%r11,%rcx,4), %rdi
  264. addsd %xmm10, %xmm1
  265. addq %r8, %rdi
  266. movaps %xmm1, %xmm0
  267. shlq $52, %rdi
  268. addsd %xmm2, %xmm0
  269. movq %rdi, 24(%rsp)
  270. cmpl $-130815, %edx
  271. jg ..B1.26
  272. ..B1.18:
  273. movsd %xmm0, (%rsp)
  274. andl $-4096, (%rsp)
  275. movsd (%rsp), %xmm0
  276. movzwl 34(%rsp), %edx
  277. movl %edx, %eax
  278. andl $768, %eax
  279. subsd %xmm0, %xmm2
  280. cmpl $768, %eax
  281. addsd %xmm1, %xmm2
  282. je ..B1.22
  283. ..B1.19:
  284. orl $-64768, %edx
  285. movw %dx, 32(%rsp)
  286. ..B1.20:
  287. fldcw 32(%rsp)
  288. ..B1.21:
  289. movsd (%rsp), %xmm0
  290. movb $1, %sil
  291. ..B1.22:
  292. fldl 24(%rsp)
  293. lea _SC2(%rip), %rax
  294. movsd %xmm0, (%rsp)
  295. testb %sil, %sil
  296. fldl (%rsp)
  297. movsd %xmm2, (%rsp)
  298. fldl (%rsp)
  299. faddp %st, %st(1)
  300. fmulp %st, %st(1)
  301. fmull (%rax,%rcx,8)
  302. fstpl 8(%rsp)
  303. je ..B1.24
  304. ..B1.23:
  305. fldcw 34(%rsp)
  306. ..B1.24:
  307. cmpl $1048576, 12(%rsp)
  308. jl ..B1.8
  309. ..B1.25:
  310. movsd 8(%rsp), %xmm0
  311. addq $56, %rsp
  312. .cfi_def_cfa_offset 8
  313. ret
  314. .cfi_def_cfa_offset 64
  315. ..B1.26:
  316. movsd 24(%rsp), %xmm1
  317. lea _SC2(%rip), %rax
  318. mulsd %xmm1, %xmm0
  319. mulsd (%rax,%rcx,8), %xmm0
  320. movsd %xmm0, 8(%rsp)
  321. ..B1.27:
  322. addq $56, %rsp
  323. .cfi_def_cfa_offset 8
  324. ret
  325. .cfi_def_cfa_offset 64
  326. ..B1.28:
  327. cmpl $2146435072, %eax
  328. jae ..B1.33
  329. ..B1.29:
  330. testl $-2147483648, %edx
  331. je ..B1.31
  332. ..B1.30:
  333. lea _small_value_64(%rip), %rax
  334. movsd (%rax), %xmm1
  335. movaps %xmm1, %xmm0
  336. mulsd %xmm1, %xmm0
  337. movsd %xmm0, 8(%rsp)
  338. addq $56, %rsp
  339. .cfi_def_cfa_offset 8
  340. ret
  341. .cfi_def_cfa_offset 64
  342. ..B1.31:
  343. lea _large_value_64(%rip), %rax
  344. movsd (%rax), %xmm1
  345. movaps %xmm1, %xmm0
  346. mulsd %xmm1, %xmm0
  347. movsd %xmm0, 8(%rsp)
  348. ..B1.32:
  349. addq $56, %rsp
  350. .cfi_def_cfa_offset 8
  351. ret
  352. .cfi_def_cfa_offset 64
  353. ..B1.33:
  354. addl $-2146435072, %eax
  355. orl 40(%rsp), %eax
  356. jne ..B1.35
  357. ..B1.34:
  358. lea _inf_zero(%rip), %rax
  359. movsd (%rax,%rcx,8), %xmm0
  360. addq $56, %rsp
  361. .cfi_def_cfa_offset 8
  362. ret
  363. .cfi_def_cfa_offset 64
  364. ..B1.35:
  365. movsd 40(%rsp), %xmm0
  366. addsd %xmm0, %xmm0
  367. ..B1.36:
  368. addq $56, %rsp
  369. .cfi_def_cfa_offset 8
  370. ret
  371. .cfi_def_cfa_offset 64
  372. ..B1.37:
  373. addl $1074, %ecx
  374. movl $1, %eax
  375. shlq %cl, %rax
  376. movq %rax, 8(%rsp)
  377. jmp ..B1.8
  378. .align 16,0x90
  379. .cfi_endproc
  380. .type exp2,@function
  381. .size exp2,.-exp2
  382. .data
  383. # -- End exp2
  384. .section .rodata, "a"
  385. .align 8
  386. .align 8
  387. .L_2il0floatpacket.0:
  388. .long 0x00000000,0x40600000
  389. .type .L_2il0floatpacket.0,@object
  390. .size .L_2il0floatpacket.0,8
  391. .align 8
  392. .L_2il0floatpacket.1:
  393. .long 0x00000000,0xbf800000
  394. .type .L_2il0floatpacket.1,@object
  395. .size .L_2il0floatpacket.1,8
  396. .align 8
  397. .L_2il0floatpacket.2:
  398. .long 0x00000000,0x3fe62e42
  399. .type .L_2il0floatpacket.2,@object
  400. .size .L_2il0floatpacket.2,8
  401. .align 8
  402. .L_2il0floatpacket.3:
  403. .long 0x00000000,0xbff00000
  404. .type .L_2il0floatpacket.3,@object
  405. .size .L_2il0floatpacket.3,8
  406. .align 8
  407. .L_2il0floatpacket.4:
  408. .long 0xac59a345,0x3f24308c
  409. .type .L_2il0floatpacket.4,@object
  410. .size .L_2il0floatpacket.4,8
  411. .align 8
  412. .L_2il0floatpacket.5:
  413. .long 0x6fba31d1,0x3f83b2ab
  414. .type .L_2il0floatpacket.5,@object
  415. .size .L_2il0floatpacket.5,8
  416. .align 8
  417. .L_2il0floatpacket.6:
  418. .long 0xff82c58f,0x3fcebfbd
  419. .type .L_2il0floatpacket.6,@object
  420. .size .L_2il0floatpacket.6,8
  421. .align 8
  422. .L_2il0floatpacket.7:
  423. .long 0x00cb0678,0x3ef0097a
  424. .type .L_2il0floatpacket.7,@object
  425. .size .L_2il0floatpacket.7,8
  426. .align 8
  427. .L_2il0floatpacket.8:
  428. .long 0xe87ed439,0x3f55d87f
  429. .type .L_2il0floatpacket.8,@object
  430. .size .L_2il0floatpacket.8,8
  431. .align 8
  432. .L_2il0floatpacket.9:
  433. .long 0xd704a0c3,0x3fac6b08
  434. .type .L_2il0floatpacket.9,@object
  435. .size .L_2il0floatpacket.9,8
  436. .align 8
  437. .L_2il0floatpacket.10:
  438. .long 0x3de6af28,0x3e9fdf47
  439. .type .L_2il0floatpacket.10,@object
  440. .size .L_2il0floatpacket.10,8
  441. .align 8
  442. .L_2il0floatpacket.11:
  443. .long 0x00000000,0x3ff00000
  444. .type .L_2il0floatpacket.11,@object
  445. .size .L_2il0floatpacket.11,8
  446. .align 4
  447. _TWO_52H:
  448. .long 0
  449. .long 1127743488
  450. .type _TWO_52H,@object
  451. .size _TWO_52H,8
  452. .align 4
  453. _two_32p1:
  454. .long 1048576
  455. .long 1106247680
  456. .type _two_32p1,@object
  457. .size _two_32p1,8
  458. .align 4
  459. _two_32:
  460. .long 0
  461. .long 1106247680
  462. .type _two_32,@object
  463. .size _two_32,8
  464. .align 4
  465. _range:
  466. .long 4294967295
  467. .long 1083179007
  468. .long 4294967295
  469. .long 1083232255
  470. .type _range,@object
  471. .size _range,16
  472. .align 4
  473. SC2_BIAS:
  474. .long 511
  475. .long 1535
  476. .type SC2_BIAS,@object
  477. .size SC2_BIAS,8
  478. .align 4
  479. _SC2:
  480. .long 0
  481. .long 1609564160
  482. .long 0
  483. .long 535822336
  484. .type _SC2,@object
  485. .size _SC2,16
  486. .align 4
  487. _small_value_64:
  488. .long 0
  489. .long 24117248
  490. .long 0
  491. .long 2171600896
  492. .type _small_value_64,@object
  493. .size _small_value_64,16
  494. .align 4
  495. _large_value_64:
  496. .long 0
  497. .long 2121269248
  498. .long 0
  499. .long 4268752896
  500. .type _large_value_64,@object
  501. .size _large_value_64,16
  502. .align 4
  503. _inf_zero:
  504. .long 0
  505. .long 2146435072
  506. .long 0
  507. .long 0
  508. .type _inf_zero,@object
  509. .size _inf_zero,16
  510. .data
  511. .section .note.GNU-stack, ""
  512. // -- Begin DWARF2 SEGMENT .eh_frame
  513. .section .eh_frame,"a",@progbits
  514. .eh_frame_seg:
  515. .align 1
  516. # End