cosh_gen.S 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  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 "cosh_gen.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin cosh
  41. .text
  42. .align 16,0x90
  43. .globl cosh
  44. cosh:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_cosh.1:
  49. ..L2:
  50. movsd %xmm0, -8(%rsp)
  51. movl -4(%rsp), %eax
  52. andl $2147483647, %eax
  53. cmpl $1077338037, %eax
  54. jae ..B1.8
  55. ..B1.2:
  56. cmpl $1065646817, %eax
  57. jae ..B1.7
  58. ..B1.3:
  59. movsd .L_2il0floatpacket.12(%rip), %xmm4
  60. cmpl $1012924416, %eax
  61. jae ..B1.5
  62. ..B1.4:
  63. andps .L_2il0floatpacket.11(%rip), %xmm0
  64. addsd %xmm4, %xmm0
  65. movsd %xmm0, -24(%rsp)
  66. ret
  67. ..B1.5:
  68. movsd -8(%rsp), %xmm1
  69. mulsd %xmm1, %xmm1
  70. movaps %xmm1, %xmm2
  71. mulsd %xmm1, %xmm2
  72. movsd .L_2il0floatpacket.9(%rip), %xmm0
  73. mulsd %xmm2, %xmm0
  74. movsd .L_2il0floatpacket.10(%rip), %xmm3
  75. mulsd %xmm2, %xmm3
  76. addsd .L_2il0floatpacket.8(%rip), %xmm0
  77. mulsd %xmm1, %xmm0
  78. addsd %xmm3, %xmm0
  79. addsd %xmm4, %xmm0
  80. ..B1.6:
  81. ret
  82. ..B1.7:
  83. movsd -8(%rsp), %xmm1
  84. lea _TWO_52(%rip), %rax
  85. andps .L_2il0floatpacket.11(%rip), %xmm1
  86. lea _ptwo_32p1(%rip), %rcx
  87. movsd .L_2il0floatpacket.0(%rip), %xmm2
  88. lea _ntwo_32p1(%rip), %rsi
  89. mulsd %xmm1, %xmm2
  90. lea _two_32(%rip), %rdi
  91. movsd .L_2il0floatpacket.1(%rip), %xmm3
  92. movsd %xmm1, -8(%rsp)
  93. movsd .L_2il0floatpacket.2(%rip), %xmm4
  94. movsd (%rcx), %xmm6
  95. movsd (%rsi), %xmm7
  96. movsd .L_2il0floatpacket.4(%rip), %xmm13
  97. movsd .L_2il0floatpacket.6(%rip), %xmm14
  98. movsd .L_2il0floatpacket.3(%rip), %xmm8
  99. movsd .L_2il0floatpacket.3(%rip), %xmm9
  100. movq __libm_exp_table_128@GOTPCREL(%rip), %r10
  101. addsd (%rax), %xmm2
  102. movsd %xmm2, -24(%rsp)
  103. movsd -24(%rsp), %xmm5
  104. movl -24(%rsp), %r9d
  105. movl %r9d, %edx
  106. shll $25, %edx
  107. subsd (%rax), %xmm5
  108. mulsd %xmm5, %xmm3
  109. mulsd %xmm4, %xmm5
  110. subsd %xmm3, %xmm1
  111. movaps %xmm1, %xmm10
  112. sarl $25, %edx
  113. subsd %xmm5, %xmm10
  114. movaps %xmm10, %xmm11
  115. movaps %xmm10, %xmm15
  116. movslq %edx, %rdx
  117. subsd %xmm10, %xmm1
  118. addsd %xmm10, %xmm6
  119. subsd %xmm10, %xmm7
  120. subsd %xmm5, %xmm1
  121. movsd %xmm6, -40(%rsp)
  122. subl %edx, %r9d
  123. movsd %xmm7, -32(%rsp)
  124. pxor %xmm5, %xmm5
  125. movsd -40(%rsp), %xmm2
  126. addsd %xmm1, %xmm11
  127. subsd (%rdi), %xmm2
  128. movaps %xmm11, %xmm12
  129. addsd %xmm2, %xmm8
  130. mulsd %xmm11, %xmm12
  131. subsd %xmm8, %xmm15
  132. mulsd %xmm12, %xmm13
  133. mulsd %xmm12, %xmm14
  134. addsd %xmm1, %xmm15
  135. addsd .L_2il0floatpacket.5(%rip), %xmm13
  136. addsd .L_2il0floatpacket.7(%rip), %xmm14
  137. mulsd %xmm12, %xmm13
  138. mulsd %xmm12, %xmm14
  139. mulsd %xmm11, %xmm13
  140. addsd .L_2il0floatpacket.8(%rip), %xmm14
  141. addsd %xmm13, %xmm15
  142. mulsd %xmm12, %xmm14
  143. movsd -32(%rsp), %xmm0
  144. addsd %xmm14, %xmm15
  145. addsd (%rdi), %xmm0
  146. shlq $4, %rdx
  147. addsd %xmm0, %xmm9
  148. movsd 1032(%r10,%rdx), %xmm8
  149. addsd %xmm9, %xmm10
  150. movaps %xmm8, %xmm4
  151. addsd %xmm10, %xmm1
  152. mulsd %xmm15, %xmm4
  153. addsd %xmm2, %xmm15
  154. mulsd %xmm8, %xmm2
  155. mulsd 1024(%r10,%rdx), %xmm15
  156. xorps .L_2il0floatpacket.13(%rip), %xmm1
  157. negq %rdx
  158. shrl $7, %r9d
  159. subsd %xmm13, %xmm1
  160. addsd %xmm15, %xmm4
  161. addsd %xmm14, %xmm1
  162. movsd 1032(%r10,%rdx), %xmm15
  163. movaps %xmm15, %xmm3
  164. mulsd %xmm1, %xmm3
  165. addsd %xmm0, %xmm1
  166. mulsd %xmm15, %xmm0
  167. mulsd 1024(%r10,%rdx), %xmm1
  168. shll $23, %r9d
  169. addsd %xmm1, %xmm3
  170. pxor %xmm1, %xmm1
  171. lea 1056964608(%r9), %r8d
  172. negl %r9d
  173. addl $1056964608, %r9d
  174. movl %r9d, -12(%rsp)
  175. movl %r8d, -16(%rsp)
  176. cvtss2sd -12(%rsp), %xmm5
  177. cvtss2sd -16(%rsp), %xmm1
  178. mulsd %xmm5, %xmm3
  179. mulsd %xmm0, %xmm5
  180. mulsd %xmm1, %xmm4
  181. mulsd %xmm2, %xmm1
  182. addsd %xmm3, %xmm4
  183. movaps %xmm5, %xmm0
  184. addsd %xmm1, %xmm0
  185. subsd %xmm0, %xmm1
  186. addsd %xmm1, %xmm5
  187. addsd %xmm4, %xmm5
  188. addsd %xmm5, %xmm0
  189. ret
  190. ..B1.8:
  191. cmpl $1082536910, %eax
  192. jb ..B1.14
  193. ..B1.9:
  194. jne ..B1.11
  195. ..B1.10:
  196. cmpl $-1883637635, -8(%rsp)
  197. jbe ..B1.14
  198. ..B1.11:
  199. cmpl $2146435072, %eax
  200. jb ..B1.15
  201. ..B1.12:
  202. movsd -8(%rsp), %xmm0
  203. mulsd %xmm0, %xmm0
  204. ..B1.13:
  205. ret
  206. ..B1.14:
  207. movsd -8(%rsp), %xmm12
  208. lea _TWO_52(%rip), %rax
  209. andps .L_2il0floatpacket.11(%rip), %xmm12
  210. lea _ptwo_32p1(%rip), %rdx
  211. movsd .L_2il0floatpacket.0(%rip), %xmm0
  212. lea _two_32(%rip), %rcx
  213. mulsd %xmm12, %xmm0
  214. lea _TWO_512(%rip), %r9
  215. movsd .L_2il0floatpacket.1(%rip), %xmm1
  216. movsd %xmm12, -8(%rsp)
  217. movsd .L_2il0floatpacket.2(%rip), %xmm2
  218. movsd .L_2il0floatpacket.6(%rip), %xmm11
  219. movsd .L_2il0floatpacket.4(%rip), %xmm8
  220. movsd (%rdx), %xmm4
  221. movsd .L_2il0floatpacket.3(%rip), %xmm5
  222. movsd .L_2il0floatpacket.8(%rip), %xmm10
  223. movq __libm_exp_table_128@GOTPCREL(%rip), %r8
  224. movl $0, -16(%rsp)
  225. addsd (%rax), %xmm0
  226. movsd %xmm0, -24(%rsp)
  227. movsd -24(%rsp), %xmm3
  228. movl -24(%rsp), %esi
  229. movl %esi, %edi
  230. shll $25, %edi
  231. subsd (%rax), %xmm3
  232. mulsd %xmm3, %xmm1
  233. mulsd %xmm2, %xmm3
  234. subsd %xmm1, %xmm12
  235. movaps %xmm12, %xmm6
  236. sarl $25, %edi
  237. subsd %xmm3, %xmm6
  238. movaps %xmm6, %xmm7
  239. subl %edi, %esi
  240. movslq %edi, %rdi
  241. subsd %xmm6, %xmm12
  242. addsd %xmm6, %xmm4
  243. subsd %xmm3, %xmm12
  244. movsd %xmm4, -24(%rsp)
  245. addsd %xmm12, %xmm7
  246. movaps %xmm7, %xmm9
  247. mulsd %xmm7, %xmm9
  248. mulsd %xmm9, %xmm11
  249. mulsd %xmm9, %xmm8
  250. mulsd %xmm9, %xmm10
  251. addsd .L_2il0floatpacket.7(%rip), %xmm11
  252. addsd .L_2il0floatpacket.5(%rip), %xmm8
  253. mulsd %xmm9, %xmm11
  254. mulsd %xmm7, %xmm8
  255. movsd -24(%rsp), %xmm0
  256. addsd %xmm8, %xmm11
  257. subsd (%rcx), %xmm0
  258. mulsd %xmm9, %xmm11
  259. addsd %xmm0, %xmm5
  260. addsd %xmm10, %xmm11
  261. subsd %xmm5, %xmm6
  262. shlq $4, %rdi
  263. addsd %xmm6, %xmm12
  264. movsd 1032(%r8,%rdi), %xmm13
  265. addsd %xmm11, %xmm12
  266. movaps %xmm13, %xmm14
  267. mulsd %xmm12, %xmm14
  268. addsd %xmm0, %xmm12
  269. mulsd %xmm13, %xmm0
  270. mulsd 1024(%r8,%rdi), %xmm12
  271. shrl $7, %esi
  272. addsd %xmm12, %xmm14
  273. shll $20, %esi
  274. addsd %xmm14, %xmm0
  275. addl $534773760, %esi
  276. movl %esi, -12(%rsp)
  277. mulsd -16(%rsp), %xmm0
  278. mulsd (%r9), %xmm0
  279. ret
  280. ..B1.15:
  281. lea _large_value_64(%rip), %rax
  282. movsd (%rax), %xmm1
  283. movaps %xmm1, %xmm0
  284. mulsd %xmm1, %xmm0
  285. ret
  286. .align 16,0x90
  287. .cfi_endproc
  288. .type cosh,@function
  289. .size cosh,.-cosh
  290. .data
  291. # -- End cosh
  292. .section .rodata, "a"
  293. .align 16
  294. .align 16
  295. .L_2il0floatpacket.11:
  296. .long 0xffffffff,0x7fffffff,0x00000000,0x00000000
  297. .type .L_2il0floatpacket.11,@object
  298. .size .L_2il0floatpacket.11,16
  299. .align 16
  300. .L_2il0floatpacket.13:
  301. .long 0x00000000,0x80000000,0x00000000,0x00000000
  302. .type .L_2il0floatpacket.13,@object
  303. .size .L_2il0floatpacket.13,16
  304. .align 8
  305. .L_2il0floatpacket.0:
  306. .long 0x652b82fe,0x40671547
  307. .type .L_2il0floatpacket.0,@object
  308. .size .L_2il0floatpacket.0,8
  309. .align 8
  310. .L_2il0floatpacket.1:
  311. .long 0x00000000,0x3f762e42
  312. .type .L_2il0floatpacket.1,@object
  313. .size .L_2il0floatpacket.1,8
  314. .align 8
  315. .L_2il0floatpacket.2:
  316. .long 0x3de6af28,0x3e2fdf47
  317. .type .L_2il0floatpacket.2,@object
  318. .size .L_2il0floatpacket.2,8
  319. .align 8
  320. .L_2il0floatpacket.3:
  321. .long 0x00000000,0xbff00000
  322. .type .L_2il0floatpacket.3,@object
  323. .size .L_2il0floatpacket.3,8
  324. .align 8
  325. .L_2il0floatpacket.4:
  326. .long 0x6887cd7c,0x3f811111
  327. .type .L_2il0floatpacket.4,@object
  328. .size .L_2il0floatpacket.4,8
  329. .align 8
  330. .L_2il0floatpacket.5:
  331. .long 0x55555405,0x3fc55555
  332. .type .L_2il0floatpacket.5,@object
  333. .size .L_2il0floatpacket.5,8
  334. .align 8
  335. .L_2il0floatpacket.6:
  336. .long 0x87372663,0x3f56c16c
  337. .type .L_2il0floatpacket.6,@object
  338. .size .L_2il0floatpacket.6,8
  339. .align 8
  340. .L_2il0floatpacket.7:
  341. .long 0x5555541d,0x3fa55555
  342. .type .L_2il0floatpacket.7,@object
  343. .size .L_2il0floatpacket.7,8
  344. .align 8
  345. .L_2il0floatpacket.8:
  346. .long 0x00000000,0x3fe00000
  347. .type .L_2il0floatpacket.8,@object
  348. .size .L_2il0floatpacket.8,8
  349. .align 8
  350. .L_2il0floatpacket.9:
  351. .long 0x6a3d464e,0x3f56c171
  352. .type .L_2il0floatpacket.9,@object
  353. .size .L_2il0floatpacket.9,8
  354. .align 8
  355. .L_2il0floatpacket.10:
  356. .long 0x5554a6cf,0x3fa55555
  357. .type .L_2il0floatpacket.10,@object
  358. .size .L_2il0floatpacket.10,8
  359. .align 8
  360. .L_2il0floatpacket.12:
  361. .long 0x00000000,0x3ff00000
  362. .type .L_2il0floatpacket.12,@object
  363. .size .L_2il0floatpacket.12,8
  364. .align 4
  365. _TWO_52:
  366. .long 0
  367. .long 1127219200
  368. .type _TWO_52,@object
  369. .size _TWO_52,8
  370. .align 4
  371. _ptwo_32p1:
  372. .long 1048576
  373. .long 1106247680
  374. .type _ptwo_32p1,@object
  375. .size _ptwo_32p1,8
  376. .align 4
  377. _ntwo_32p1:
  378. .long 4292870144
  379. .long 3253731327
  380. .type _ntwo_32p1,@object
  381. .size _ntwo_32p1,8
  382. .align 4
  383. _two_32:
  384. .long 0
  385. .long 1106247680
  386. .type _two_32,@object
  387. .size _two_32,8
  388. .align 4
  389. _TWO_512:
  390. .long 0
  391. .long 1609564160
  392. .type _TWO_512,@object
  393. .size _TWO_512,8
  394. .align 4
  395. _large_value_64:
  396. .long 0
  397. .long 2121269248
  398. .long 0
  399. .long 4268752896
  400. .type _large_value_64,@object
  401. .size _large_value_64,16
  402. .data
  403. .section .note.GNU-stack, ""
  404. // -- Begin DWARF2 SEGMENT .eh_frame
  405. .section .eh_frame,"a",@progbits
  406. .eh_frame_seg:
  407. .align 1
  408. # End