csinhf.S 9.3 KB

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