ccoshf.S 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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 "ccoshf.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin ccoshf
  41. .text
  42. .align 16,0x90
  43. .globl ccoshf
  44. ccoshf:
  45. # parameter 1: 8 + %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 $116, %esp
  55. xorl %eax, %eax
  56. movl %eax, 48(%esp)
  57. movl %eax, 52(%esp)
  58. ..B1.2:
  59. fnstcw 38(%esp)
  60. ..B1.3:
  61. movzwl 10(%ebp), %esi
  62. andl $32640, %esi
  63. shrl $7, %esi
  64. call ..L2
  65. ..L2:
  66. popl %ebx
  67. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%ebx), %ebx
  68. cmpl $255, %esi
  69. jge ..B1.18
  70. ..B1.4:
  71. testl %esi, %esi
  72. jle ..B1.47
  73. ..B1.5:
  74. movzwl 14(%ebp), %edi
  75. andl $32640, %edi
  76. shrl $7, %edi
  77. cmpl $255, %edi
  78. jge ..B1.19
  79. ..B1.6:
  80. testl %edi, %edi
  81. jle ..B1.46
  82. ..B1.7:
  83. cmpl $138, %esi
  84. jl ..B1.11
  85. ..B1.8:
  86. fldl _DBL_MAX_NORMAL@GOTOFF(%ebx)
  87. fmul %st(0), %st
  88. flds 12(%ebp)
  89. fsts 8(%esp)
  90. addl $-16, %esp
  91. fstps (%esp)
  92. fstpl 16(%esp)
  93. call cosf@PLT
  94. ..B1.57:
  95. fldl 16(%esp)
  96. addl $16, %esp
  97. fmul %st, %st(1)
  98. testl %edi, %edi
  99. fxch %st(1)
  100. fstps 48(%esp)
  101. flds 8(%ebp)
  102. fmulp %st, %st(1)
  103. jle ..B1.10
  104. ..B1.9:
  105. addl $-16, %esp
  106. flds 24(%esp)
  107. fstps (%esp)
  108. fstpl 16(%esp)
  109. call sinf@PLT
  110. ..B1.58:
  111. fldl 16(%esp)
  112. addl $16, %esp
  113. fmulp %st, %st(1)
  114. fstps 52(%esp)
  115. jmp ..B1.41
  116. ..B1.10:
  117. fmuls 8(%esp)
  118. fstps 52(%esp)
  119. jmp ..B1.41
  120. ..B1.11:
  121. movzwl 38(%esp), %edx
  122. movl %edx, %eax
  123. andl $768, %eax
  124. cmpl $768, %eax
  125. je ..B1.45
  126. ..B1.12:
  127. orl $-64768, %edx
  128. movw %dx, 36(%esp)
  129. ..B1.13:
  130. fldcw 36(%esp)
  131. ..B1.14:
  132. movl $1, %esi
  133. ..B1.15:
  134. flds 8(%ebp)
  135. fstps 32(%esp)
  136. flds 12(%ebp)
  137. fsts 24(%esp)
  138. addl $-16, %esp
  139. fstpl (%esp)
  140. call sin@PLT
  141. ..B1.61:
  142. addl $16, %esp
  143. fstpl 16(%esp)
  144. addl $-16, %esp
  145. flds 40(%esp)
  146. fstpl (%esp)
  147. call cos@PLT
  148. ..B1.60:
  149. addl $16, %esp
  150. fstpl 24(%esp)
  151. addl $-16, %esp
  152. flds 48(%esp)
  153. lea 16(%esp), %eax
  154. lea 24(%esp), %edx
  155. fstpl (%esp)
  156. movl %eax, 8(%esp)
  157. movl %edx, 12(%esp)
  158. call sinhcosh@PLT
  159. ..B1.59:
  160. addl $16, %esp
  161. ..B1.16:
  162. fldl 24(%esp)
  163. testl %esi, %esi
  164. fmull 8(%esp)
  165. fstps 48(%esp)
  166. fldl 16(%esp)
  167. fmull (%esp)
  168. fstps 52(%esp)
  169. je ..B1.41
  170. ..B1.17:
  171. fldcw 38(%esp)
  172. jmp ..B1.41
  173. ..B1.18:
  174. movzwl 14(%ebp), %edi
  175. andl $32640, %edi
  176. shrl $7, %edi
  177. ..B1.19:
  178. testl %edi, %edi
  179. jne ..B1.24
  180. ..B1.20:
  181. testl $8388607, 12(%ebp)
  182. jne ..B1.24
  183. ..B1.21:
  184. addl $-16, %esp
  185. movl 8(%ebp), %eax
  186. movl %eax, (%esp)
  187. call coshf@PLT
  188. ..B1.62:
  189. movl 12(%ebp), %eax
  190. addl $16, %esp
  191. fstps 48(%esp)
  192. cmpl $255, %esi
  193. movl %eax, 52(%esp)
  194. jl ..B1.23
  195. ..B1.22:
  196. testl $8388607, 8(%ebp)
  197. jne ..B1.41
  198. ..B1.23:
  199. movzbl 55(%esp), %edi
  200. movl %edi, %eax
  201. movzbl 11(%ebp), %esi
  202. andl $127, %eax
  203. shrl $7, %edi
  204. shrl $7, %esi
  205. xorl %esi, %edi
  206. shll $7, %edi
  207. orl %edi, %eax
  208. movb %al, 55(%esp)
  209. jmp ..B1.41
  210. ..B1.24:
  211. cmpl $255, %edi
  212. jge ..B1.36
  213. ..B1.25:
  214. movl 8(%ebp), %eax
  215. andl $8388607, %eax
  216. testl %esi, %esi
  217. jne ..B1.70
  218. ..B1.26:
  219. testl %eax, %eax
  220. jne ..B1.31
  221. ..B1.27:
  222. flds 12(%ebp)
  223. fsts 4(%esp)
  224. addl $-16, %esp
  225. fstps (%esp)
  226. call cosf@PLT
  227. ..B1.63:
  228. flds 8(%ebp)
  229. addl $16, %esp
  230. fxch %st(1)
  231. fstps 48(%esp)
  232. testl %edi, %edi
  233. jle ..B1.29
  234. ..B1.28:
  235. addl $-16, %esp
  236. flds 20(%esp)
  237. fstps (%esp)
  238. fstps 16(%esp)
  239. call sinf@PLT
  240. ..B1.64:
  241. flds 16(%esp)
  242. addl $16, %esp
  243. fmulp %st, %st(1)
  244. jmp ..B1.30
  245. ..B1.29:
  246. fmuls 4(%esp)
  247. ..B1.30:
  248. fldl _DBL_MAX_NORMAL@GOTOFF(%ebx)
  249. fxch %st(1)
  250. fstps 52(%esp)
  251. fsubl _DBL_MIN_NORMAL@GOTOFF(%ebx)
  252. fstpl 40(%esp)
  253. jmp ..B1.41
  254. ..B1.70:
  255. testl %eax, %eax
  256. ..B1.31:
  257. flds 8(%ebp)
  258. jne ..B1.35
  259. ..B1.32:
  260. fld %st(0)
  261. cmpl $127, %edi
  262. fmul %st(1), %st
  263. fstps 8(%esp)
  264. jge ..B1.34
  265. ..B1.33:
  266. flds 8(%esp)
  267. fstps 48(%esp)
  268. fmuls 12(%ebp)
  269. fstps 52(%esp)
  270. jmp ..B1.41
  271. ..B1.34:
  272. addl $-16, %esp
  273. movl 12(%ebp), %esi
  274. movl %esi, (%esp)
  275. fstps 20(%esp)
  276. call sinf@PLT
  277. ..B1.66:
  278. flds 20(%esp)
  279. addl $16, %esp
  280. fxch %st(1)
  281. fstps (%esp)
  282. addl $-16, %esp
  283. movl %esi, (%esp)
  284. fstps 20(%esp)
  285. call cosf@PLT
  286. ..B1.65:
  287. flds 20(%esp)
  288. addl $16, %esp
  289. flds 8(%esp)
  290. fmulp %st, %st(2)
  291. fxch %st(1)
  292. fstps 48(%esp)
  293. fmuls (%esp)
  294. fstps 52(%esp)
  295. jmp ..B1.41
  296. ..B1.35:
  297. fmul %st(0), %st
  298. fsts 48(%esp)
  299. fstps 52(%esp)
  300. jmp ..B1.41
  301. ..B1.36:
  302. cmpl $255, %esi
  303. jge ..B1.38
  304. ..B1.37:
  305. addl $-16, %esp
  306. movl 12(%ebp), %eax
  307. movl %eax, (%esp)
  308. call cosf@PLT
  309. jmp ..B1.68
  310. ..B1.38:
  311. addl $-16, %esp
  312. movl 8(%ebp), %eax
  313. movl %eax, (%esp)
  314. call coshf@PLT
  315. ..B1.68:
  316. addl $16, %esp
  317. fstps 48(%esp)
  318. ..B1.39:
  319. testl %esi, %esi
  320. jle ..B1.49
  321. ..B1.40:
  322. addl $-16, %esp
  323. movl 12(%ebp), %eax
  324. movl %eax, (%esp)
  325. call sinf@PLT
  326. ..B1.69:
  327. addl $16, %esp
  328. fstps 52(%esp)
  329. ..B1.41:
  330. movzwl 54(%esp), %eax
  331. testl $32640, %eax
  332. jne ..B1.44
  333. ..B1.42:
  334. testl $8388607, 52(%esp)
  335. je ..B1.44
  336. ..B1.43:
  337. fldl _DBL_MIN_NORMAL@GOTOFF(%ebx)
  338. fmul %st(0), %st
  339. fstpl 40(%esp)
  340. ..B1.44:
  341. movl 48(%esp), %eax
  342. movl 52(%esp), %edx
  343. addl $116, %esp
  344. popl %ebx
  345. popl %edi
  346. popl %esi
  347. movl %ebp, %esp
  348. popl %ebp
  349. ret
  350. ..B1.45:
  351. xorl %esi, %esi
  352. jmp ..B1.15
  353. ..B1.46:
  354. testl $8388607, 12(%ebp)
  355. jne ..B1.7
  356. jmp ..B1.19
  357. ..B1.47:
  358. testl $8388607, 8(%ebp)
  359. jne ..B1.5
  360. jmp ..B1.18
  361. ..B1.49:
  362. testl $8388607, 8(%ebp)
  363. jne ..B1.40
  364. ..B1.50:
  365. testl $8388607, 12(%ebp)
  366. jne ..B1.53
  367. ..B1.51:
  368. movzbl 11(%ebp), %edx
  369. movzbl 15(%ebp), %eax
  370. andl $128, %edx
  371. andl $128, %eax
  372. shrl $7, %edx
  373. shrl $7, %eax
  374. cmpl %edx, %eax
  375. je ..B1.53
  376. ..B1.52:
  377. movl $-2147483648, 52(%esp)
  378. jmp ..B1.41
  379. ..B1.53:
  380. movl $0, 52(%esp)
  381. jmp ..B1.41
  382. .align 16,0x90
  383. .type ccoshf,@function
  384. .size ccoshf,.-ccoshf
  385. .data
  386. # -- End ccoshf
  387. .section .rodata, "a"
  388. .align 16
  389. .align 16
  390. _DBL_MAX_NORMAL:
  391. .long -1
  392. .long 2146435071
  393. .type _DBL_MAX_NORMAL,@object
  394. .size _DBL_MAX_NORMAL,8
  395. .space 8, 0x00 # pad
  396. .align 16
  397. _DBL_MIN_NORMAL:
  398. .long 0
  399. .long 1048576
  400. .type _DBL_MIN_NORMAL,@object
  401. .size _DBL_MIN_NORMAL,8
  402. .align 4
  403. .L_2il0floatpacket.6:
  404. .long 0x80000000
  405. .type .L_2il0floatpacket.6,@object
  406. .size .L_2il0floatpacket.6,4
  407. .data
  408. .section .note.GNU-stack, ""
  409. # End