ccosh.S 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  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 "ccosh.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin ccoshf
  41. .text
  42. .align 16,0x90
  43. .globl ccoshf
  44. ccoshf:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_ccoshf.1:
  49. ..L2:
  50. subq $24, %rsp
  51. .cfi_def_cfa_offset 32
  52. cvtps2pd %xmm0, %xmm1
  53. movaps %xmm1, %xmm0
  54. unpckhpd %xmm1, %xmm1
  55. ..___tag_value_ccoshf.4:
  56. call ccosh@PLT
  57. ..___tag_value_ccoshf.5:
  58. ..B1.10:
  59. unpcklpd %xmm1, %xmm0
  60. ..B1.2:
  61. cvtpd2ps %xmm0, %xmm0
  62. movsd %xmm0, 4(%rsp)
  63. movzwl 6(%rsp), %eax
  64. testl $32640, %eax
  65. jne ..B1.4
  66. ..B1.3:
  67. testl $8388607, 4(%rsp)
  68. jne ..B1.6
  69. ..B1.4:
  70. movzwl 10(%rsp), %eax
  71. testl $32640, %eax
  72. jne ..B1.7
  73. ..B1.5:
  74. testl $8388607, 8(%rsp)
  75. je ..B1.7
  76. ..B1.6:
  77. movl $8388608, (%rsp)
  78. movss (%rsp), %xmm1
  79. movss (%rsp), %xmm0
  80. mulss %xmm0, %xmm1
  81. movsd 4(%rsp), %xmm0
  82. movss %xmm1, (%rsp)
  83. ..B1.7:
  84. addq $24, %rsp
  85. .cfi_def_cfa_offset 8
  86. ret
  87. .align 16,0x90
  88. .cfi_endproc
  89. .type ccoshf,@function
  90. .size ccoshf,.-ccoshf
  91. .data
  92. # -- End ccoshf
  93. .text
  94. # -- Begin ccosh
  95. .text
  96. .align 16,0x90
  97. .globl ccosh
  98. ccosh:
  99. # parameter 1: %xmm0
  100. ..B2.1:
  101. .cfi_startproc
  102. ..___tag_value_ccosh.8:
  103. ..L9:
  104. pushq %r12
  105. .cfi_def_cfa_offset 16
  106. .cfi_offset 12, -16
  107. pushq %r13
  108. .cfi_def_cfa_offset 24
  109. .cfi_offset 13, -24
  110. pushq %rbp
  111. .cfi_def_cfa_offset 32
  112. .cfi_offset 6, -32
  113. movq %fs:40, %rax
  114. subq $112, %rsp
  115. .cfi_def_cfa_offset 144
  116. movsd %xmm0, 48(%rsp)
  117. xorq %rsp, %rax
  118. movzwl 54(%rsp), %r12d
  119. andl $32752, %r12d
  120. shrl $4, %r12d
  121. movsd %xmm1, 56(%rsp)
  122. cmpl $2047, %r12d
  123. movq %rax, 96(%rsp)
  124. jge ..B2.23
  125. ..B2.2:
  126. testl %r12d, %r12d
  127. jle ..B2.46
  128. ..B2.3:
  129. movzwl 62(%rsp), %ebp
  130. andl $32752, %ebp
  131. shrl $4, %ebp
  132. cmpl $2047, %ebp
  133. jge ..B2.24
  134. ..B2.4:
  135. testl %ebp, %ebp
  136. jle ..B2.44
  137. ..B2.5:
  138. cmpl $1034, %r12d
  139. jl ..B2.11
  140. ..B2.6:
  141. lea _CONSTANTS(%rip), %rax
  142. movsd (%rax), %xmm0
  143. mulsd %xmm0, %xmm0
  144. movsd %xmm0, 24(%rsp)
  145. movsd 56(%rsp), %xmm0
  146. movsd %xmm0, 16(%rsp)
  147. call __libm_sse2_sincos@PLT
  148. ..B2.59:
  149. movaps %xmm0, %xmm2
  150. testl %ebp, %ebp
  151. movsd 24(%rsp), %xmm0
  152. mulsd %xmm0, %xmm1
  153. mulsd 48(%rsp), %xmm0
  154. movsd %xmm0, 24(%rsp)
  155. movsd %xmm1, (%rsp)
  156. movsd %xmm0, 8(%rsp)
  157. jle ..B2.8
  158. ..B2.7:
  159. mulsd %xmm2, %xmm0
  160. movsd %xmm0, 24(%rsp)
  161. jmp ..B2.9
  162. ..B2.8:
  163. movsd 8(%rsp), %xmm0
  164. mulsd 16(%rsp), %xmm0
  165. movsd %xmm0, 24(%rsp)
  166. ..B2.9:
  167. movsd %xmm0, 8(%rsp)
  168. movq 96(%rsp), %rax
  169. xorq %rsp, %rax
  170. movsd (%rsp), %xmm0
  171. cmpq %fs:40, %rax
  172. jne ..B2.43
  173. ..B2.10:
  174. movsd 24(%rsp), %xmm1
  175. addq $112, %rsp
  176. .cfi_def_cfa_offset 32
  177. .cfi_restore 6
  178. popq %rbp
  179. .cfi_def_cfa_offset 24
  180. .cfi_restore 13
  181. popq %r13
  182. .cfi_def_cfa_offset 16
  183. .cfi_restore 12
  184. popq %r12
  185. .cfi_def_cfa_offset 8
  186. ret
  187. .cfi_def_cfa_offset 144
  188. .cfi_offset 6, -32
  189. .cfi_offset 12, -16
  190. .cfi_offset 13, -24
  191. ..B2.11:
  192. movsd 48(%rsp), %xmm0
  193. lea 64(%rsp), %rdi
  194. ..___tag_value_ccosh.28:
  195. call __libm_cosh_k64@PLT
  196. ..___tag_value_ccosh.29:
  197. ..B2.60:
  198. movl %eax, %r13d
  199. ..B2.12:
  200. movsd 64(%rsp), %xmm0
  201. movsd 72(%rsp), %xmm4
  202. movaps %xmm0, %xmm5
  203. movsd .L_2il0floatpacket.13(%rip), %xmm3
  204. addsd %xmm4, %xmm5
  205. mulsd %xmm5, %xmm3
  206. movaps %xmm5, %xmm1
  207. subsd %xmm0, %xmm1
  208. movaps %xmm3, %xmm2
  209. subsd %xmm1, %xmm4
  210. subsd %xmm5, %xmm2
  211. movzwl 54(%rsp), %eax
  212. subsd %xmm2, %xmm3
  213. andl $32752, %eax
  214. subsd %xmm3, %xmm5
  215. movsd %xmm3, 64(%rsp)
  216. cmpl $13168, %eax
  217. addsd %xmm4, %xmm5
  218. movsd %xmm5, 72(%rsp)
  219. jge ..B2.14
  220. ..B2.13:
  221. lea 16+_CONSTANTS(%rip), %r12
  222. lea 40(%rsp), %rdx
  223. movsd 8(%rdx), %xmm0
  224. pxor %xmm5, %xmm5
  225. mulsd (%r12), %xmm0
  226. movsd %xmm0, -8(%rdx)
  227. movzwl -2(%rdx), %eax
  228. movl %eax, %r12d
  229. andl $32752, %r12d
  230. andl $-32753, %eax
  231. shrl $4, %r12d
  232. orl $-49168, %eax
  233. movw %ax, -2(%rdx)
  234. addl $-1279, %r12d
  235. jmp ..B2.16
  236. ..B2.14:
  237. movsd 48(%rsp), %xmm0
  238. lea 32(%rsp), %rdi
  239. ..___tag_value_ccosh.30:
  240. call __libm_sinh_k64@PLT
  241. ..___tag_value_ccosh.31:
  242. ..B2.61:
  243. movl %eax, %r12d
  244. ..B2.15:
  245. lea 40(%rsp), %rdx
  246. movsd (%rdx), %xmm5
  247. ..B2.16:
  248. movsd 32(%rsp), %xmm0
  249. movaps %xmm5, %xmm4
  250. movsd .L_2il0floatpacket.13(%rip), %xmm3
  251. lea 16(%rsp), %rdi
  252. addsd %xmm0, %xmm4
  253. mulsd %xmm4, %xmm3
  254. movaps %xmm4, %xmm1
  255. subsd %xmm0, %xmm1
  256. movaps %xmm3, %xmm2
  257. lea 80(%rsp), %rsi
  258. movsd -24(%rsi), %xmm0
  259. subsd %xmm4, %xmm2
  260. subsd %xmm1, %xmm5
  261. subsd %xmm2, %xmm3
  262. movsd %xmm3, -48(%rsi)
  263. subsd %xmm3, %xmm4
  264. addsd %xmm4, %xmm5
  265. movsd %xmm5, (%rdx)
  266. ..___tag_value_ccosh.32:
  267. call __libm_sincos_k64@PLT
  268. ..___tag_value_ccosh.33:
  269. ..B2.17:
  270. movsd 80(%rsp), %xmm0
  271. lea 8+_CONSTANTS(%rip), %rax
  272. movsd 88(%rsp), %xmm4
  273. movaps %xmm0, %xmm3
  274. movsd .L_2il0floatpacket.13(%rip), %xmm6
  275. addsd %xmm4, %xmm3
  276. mulsd %xmm3, %xmm6
  277. movaps %xmm3, %xmm1
  278. subsd %xmm0, %xmm1
  279. movaps %xmm6, %xmm2
  280. subsd %xmm1, %xmm4
  281. subsd %xmm3, %xmm2
  282. movsd (%rax), %xmm5
  283. subsd %xmm2, %xmm6
  284. movzwl 62(%rsp), %edx
  285. subsd %xmm6, %xmm3
  286. addsd %xmm5, %xmm6
  287. addsd %xmm3, %xmm4
  288. andl $32752, %edx
  289. movsd %xmm4, 88(%rsp)
  290. cmpl $13168, %edx
  291. movsd %xmm6, 80(%rsp)
  292. jl ..B2.19
  293. ..B2.18:
  294. xorl %ebp, %ebp
  295. lea 24(%rsp), %rdx
  296. movsd (%rdx), %xmm5
  297. jmp ..B2.20
  298. ..B2.19:
  299. lea 16+_CONSTANTS(%rip), %rbp
  300. lea 24(%rsp), %rdx
  301. movsd 32(%rdx), %xmm0
  302. pxor %xmm5, %xmm5
  303. mulsd (%rbp), %xmm0
  304. movsd %xmm0, -8(%rdx)
  305. movzwl -2(%rdx), %eax
  306. movl %eax, %ebp
  307. andl $32752, %ebp
  308. andl $-32753, %eax
  309. shrl $4, %ebp
  310. orl $-49168, %eax
  311. movw %ax, -2(%rdx)
  312. addl $-1279, %ebp
  313. ..B2.20:
  314. movsd 16(%rsp), %xmm0
  315. movaps %xmm5, %xmm4
  316. movsd .L_2il0floatpacket.13(%rip), %xmm3
  317. lea 64(%rsp), %rsi
  318. movl %r13d, %edi
  319. lea (%rsp), %rcx
  320. addsd %xmm0, %xmm4
  321. mulsd %xmm4, %xmm3
  322. movaps %xmm4, %xmm1
  323. subsd %xmm0, %xmm1
  324. movaps %xmm3, %xmm2
  325. subsd %xmm1, %xmm5
  326. subsd %xmm4, %xmm2
  327. subsd %xmm2, %xmm3
  328. movsd %xmm3, 16(%rcx)
  329. subsd %xmm3, %xmm4
  330. addsd %xmm4, %xmm5
  331. movsd %xmm5, (%rdx)
  332. lea 80(%rsp), %rdx
  333. ..___tag_value_ccosh.34:
  334. call __libm_mul_k64@PLT
  335. ..___tag_value_ccosh.35:
  336. ..B2.21:
  337. addl %r12d, %ebp
  338. lea 32(%rsp), %rsi
  339. movl %ebp, %edi
  340. lea 16(%rsp), %rdx
  341. lea 8(%rsp), %rcx
  342. ..___tag_value_ccosh.36:
  343. call __libm_mul_k64@PLT
  344. ..___tag_value_ccosh.37:
  345. ..B2.22:
  346. movsd (%rsp), %xmm0
  347. movhpd 8(%rsp), %xmm0
  348. jmp ..B2.41
  349. ..B2.23:
  350. movzwl 62(%rsp), %ebp
  351. andl $32752, %ebp
  352. shrl $4, %ebp
  353. ..B2.24:
  354. testl %ebp, %ebp
  355. jne ..B2.33
  356. ..B2.25:
  357. testl $1048575, 60(%rsp)
  358. jne ..B2.33
  359. ..B2.26:
  360. cmpl $0, 56(%rsp)
  361. jne ..B2.33
  362. ..B2.27:
  363. movsd 48(%rsp), %xmm0
  364. call cosh@PLT
  365. ..B2.62:
  366. cmpl $2047, %r12d
  367. movhpd 56(%rsp), %xmm0
  368. jl ..B2.31
  369. ..B2.29:
  370. testl $1048575, 52(%rsp)
  371. jne ..B2.41
  372. ..B2.30:
  373. cmpl $0, 48(%rsp)
  374. jne ..B2.41
  375. ..B2.31:
  376. movsd %xmm0, (%rsp)
  377. movhpd %xmm0, 8(%rsp)
  378. ..B2.32:
  379. movb 15(%rsp), %dl
  380. movb %dl, %cl
  381. movb 55(%rsp), %al
  382. andb $127, %cl
  383. shrb $7, %dl
  384. shrb $7, %al
  385. movsd (%rsp), %xmm0
  386. xorb %al, %dl
  387. shlb $7, %dl
  388. orb %dl, %cl
  389. movb %cl, 15(%rsp)
  390. movhpd 8(%rsp), %xmm0
  391. jmp ..B2.41
  392. ..B2.33:
  393. cmpl $2047, %ebp
  394. jge ..B2.36
  395. ..B2.34:
  396. movsd 48(%rsp), %xmm0
  397. movsd %xmm0, 32(%rsp)
  398. call cosh@PLT
  399. ..B2.64:
  400. movsd %xmm0, 40(%rsp)
  401. movsd 56(%rsp), %xmm0
  402. movsd %xmm0, 16(%rsp)
  403. call __libm_sse2_sincos@PLT
  404. ..B2.63:
  405. movsd %xmm0, 24(%rsp)
  406. testl %ebp, %ebp
  407. movsd 40(%rsp), %xmm0
  408. mulsd %xmm1, %xmm0
  409. movsd %xmm0, (%rsp)
  410. jle ..B2.49
  411. ..B2.35:
  412. movsd 32(%rsp), %xmm0
  413. call sinh@PLT
  414. ..B2.65:
  415. mulsd 24(%rsp), %xmm0
  416. movsd %xmm0, 8(%rsp)
  417. movsd (%rsp), %xmm0
  418. movhpd 8(%rsp), %xmm0
  419. jmp ..B2.41
  420. ..B2.36:
  421. cmpl $2047, %r12d
  422. jge ..B2.38
  423. ..B2.37:
  424. movsd 56(%rsp), %xmm0
  425. call cos@PLT
  426. jmp ..B2.67
  427. ..B2.38:
  428. movsd 48(%rsp), %xmm0
  429. call cosh@PLT
  430. ..B2.67:
  431. movsd %xmm0, (%rsp)
  432. ..B2.39:
  433. testl %r12d, %r12d
  434. jle ..B2.51
  435. ..B2.40:
  436. movsd 56(%rsp), %xmm0
  437. call sin@PLT
  438. ..B2.68:
  439. movsd %xmm0, 8(%rsp)
  440. movsd (%rsp), %xmm0
  441. movhpd 8(%rsp), %xmm0
  442. ..B2.41:
  443. movq 96(%rsp), %rax
  444. xorq %rsp, %rax
  445. cmpq %fs:40, %rax
  446. jne ..B2.43
  447. ..B2.42:
  448. movaps %xmm0, %xmm1
  449. unpckhpd %xmm0, %xmm1
  450. addq $112, %rsp
  451. .cfi_def_cfa_offset 32
  452. .cfi_restore 6
  453. popq %rbp
  454. .cfi_def_cfa_offset 24
  455. .cfi_restore 13
  456. popq %r13
  457. .cfi_def_cfa_offset 16
  458. .cfi_restore 12
  459. popq %r12
  460. .cfi_def_cfa_offset 8
  461. ret
  462. .cfi_def_cfa_offset 144
  463. .cfi_offset 6, -32
  464. .cfi_offset 12, -16
  465. .cfi_offset 13, -24
  466. ..B2.43:
  467. call __stack_chk_fail@PLT
  468. ..B2.44:
  469. testl $1048575, 60(%rsp)
  470. jne ..B2.5
  471. ..B2.45:
  472. cmpl $0, 56(%rsp)
  473. jne ..B2.5
  474. jmp ..B2.24
  475. ..B2.46:
  476. testl $1048575, 52(%rsp)
  477. jne ..B2.3
  478. ..B2.47:
  479. cmpl $0, 48(%rsp)
  480. jne ..B2.3
  481. jmp ..B2.23
  482. ..B2.49:
  483. movsd 32(%rsp), %xmm0
  484. call sinh@PLT
  485. ..B2.69:
  486. mulsd 16(%rsp), %xmm0
  487. movsd %xmm0, 8(%rsp)
  488. movsd (%rsp), %xmm0
  489. movhpd 8(%rsp), %xmm0
  490. jmp ..B2.41
  491. ..B2.51:
  492. testl $1048575, 52(%rsp)
  493. jne ..B2.40
  494. ..B2.52:
  495. cmpl $0, 48(%rsp)
  496. jne ..B2.40
  497. ..B2.53:
  498. testl $1048575, 60(%rsp)
  499. jne ..B2.56
  500. ..B2.54:
  501. cmpl $0, 56(%rsp)
  502. jne ..B2.56
  503. ..B2.55:
  504. movb 55(%rsp), %dl
  505. lea ones(%rip), %rcx
  506. movb 63(%rsp), %al
  507. andb $-128, %dl
  508. andb $-128, %al
  509. pxor %xmm0, %xmm0
  510. shrb $7, %dl
  511. shrb $7, %al
  512. xorb %al, %dl
  513. movzbl %dl, %ebp
  514. mulsd (%rcx,%rbp,8), %xmm0
  515. movsd %xmm0, 8(%rsp)
  516. movsd (%rsp), %xmm0
  517. movhpd 8(%rsp), %xmm0
  518. jmp ..B2.41
  519. ..B2.56:
  520. movq $0, 8(%rsp)
  521. movsd (%rsp), %xmm0
  522. movhpd 8(%rsp), %xmm0
  523. jmp ..B2.41
  524. .align 16,0x90
  525. .cfi_endproc
  526. .type ccosh,@function
  527. .size ccosh,.-ccosh
  528. .data
  529. # -- End ccosh
  530. .section .rodata, "a"
  531. .align 8
  532. .align 8
  533. .L_2il0floatpacket.13:
  534. .long 0x02000000,0x41a00000
  535. .type .L_2il0floatpacket.13,@object
  536. .size .L_2il0floatpacket.13,8
  537. .align 8
  538. ones:
  539. .long 0x00000000,0x3ff00000
  540. .long 0x00000000,0xbff00000
  541. .type ones,@object
  542. .size ones,16
  543. .align 4
  544. .L_2il0floatpacket.12:
  545. .long 0x00800000
  546. .type .L_2il0floatpacket.12,@object
  547. .size .L_2il0floatpacket.12,4
  548. .align 4
  549. _CONSTANTS:
  550. .long 0
  551. .long 2145386496
  552. .long 0
  553. .long 1048576
  554. .long 0
  555. .long 1341128704
  556. .type _CONSTANTS,@object
  557. .size _CONSTANTS,24
  558. .data
  559. .section .note.GNU-stack, ""
  560. // -- Begin DWARF2 SEGMENT .eh_frame
  561. .section .eh_frame,"a",@progbits
  562. .eh_frame_seg:
  563. .align 1
  564. # End