tanhf_gen.S 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  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 "tanhf_gen.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin tanhf
  41. .text
  42. .align 16,0x90
  43. .globl tanhf
  44. tanhf:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_tanhf.1:
  49. ..L2:
  50. movd %xmm0, %edx
  51. movss %xmm0, -8(%rsp)
  52. movl %edx, %eax
  53. andl $2147483647, %eax
  54. cmpl $1098907648, %eax
  55. jae ..B1.15
  56. ..B1.2:
  57. cmpl $1065353216, %eax
  58. jae ..B1.14
  59. ..B1.3:
  60. cmpl $1048576000, %eax
  61. jae ..B1.12
  62. ..B1.4:
  63. cmpl $838860800, %eax
  64. jae ..B1.11
  65. ..B1.5:
  66. shrl $31, %edx
  67. cmpl $8388608, %eax
  68. jb ..B1.7
  69. ..B1.6:
  70. movl %edx, %edx
  71. lea _small_value_32(%rip), %rax
  72. movss (%rax,%rdx,4), %xmm1
  73. mulss .L_2il0floatpacket.28(%rip), %xmm1
  74. subss %xmm1, %xmm0
  75. ret
  76. ..B1.7:
  77. testl %eax, %eax
  78. je ..B1.9
  79. ..B1.8:
  80. lea _small_value_32(%rip), %rax
  81. pxor %xmm2, %xmm2
  82. pxor %xmm1, %xmm1
  83. cvtss2sd -8(%rsp), %xmm2
  84. movss (%rax,%rdx,4), %xmm0
  85. mulss .L_2il0floatpacket.28(%rip), %xmm0
  86. cvtss2sd %xmm0, %xmm0
  87. cvtsd2ss %xmm0, %xmm1
  88. subsd %xmm0, %xmm2
  89. pxor %xmm0, %xmm0
  90. movss %xmm1, -16(%rsp)
  91. cvtsd2ss %xmm2, %xmm0
  92. ret
  93. ..B1.9:
  94. movss -8(%rsp), %xmm0
  95. ..B1.10:
  96. ret
  97. ..B1.11:
  98. pxor %xmm3, %xmm3
  99. cvtss2sd -8(%rsp), %xmm3
  100. movaps %xmm3, %xmm1
  101. mulsd %xmm3, %xmm1
  102. movaps %xmm1, %xmm0
  103. mulsd %xmm1, %xmm0
  104. movsd .L_2il0floatpacket.22(%rip), %xmm4
  105. movsd .L_2il0floatpacket.25(%rip), %xmm2
  106. mulsd %xmm0, %xmm4
  107. mulsd %xmm0, %xmm2
  108. addsd .L_2il0floatpacket.23(%rip), %xmm4
  109. addsd .L_2il0floatpacket.26(%rip), %xmm2
  110. mulsd %xmm0, %xmm4
  111. mulsd %xmm0, %xmm2
  112. addsd .L_2il0floatpacket.24(%rip), %xmm4
  113. addsd .L_2il0floatpacket.27(%rip), %xmm2
  114. mulsd %xmm0, %xmm4
  115. mulsd %xmm1, %xmm2
  116. addsd %xmm2, %xmm4
  117. mulsd %xmm3, %xmm4
  118. addsd %xmm3, %xmm4
  119. jmp ..B1.13
  120. ..B1.12:
  121. pxor %xmm3, %xmm3
  122. cvtss2sd -8(%rsp), %xmm3
  123. movaps %xmm3, %xmm1
  124. mulsd %xmm3, %xmm1
  125. movaps %xmm1, %xmm0
  126. mulsd %xmm1, %xmm0
  127. movsd .L_2il0floatpacket.12(%rip), %xmm4
  128. movsd .L_2il0floatpacket.17(%rip), %xmm2
  129. mulsd %xmm0, %xmm4
  130. mulsd %xmm0, %xmm2
  131. addsd .L_2il0floatpacket.13(%rip), %xmm4
  132. addsd .L_2il0floatpacket.18(%rip), %xmm2
  133. mulsd %xmm0, %xmm4
  134. mulsd %xmm0, %xmm2
  135. addsd .L_2il0floatpacket.14(%rip), %xmm4
  136. addsd .L_2il0floatpacket.19(%rip), %xmm2
  137. mulsd %xmm0, %xmm4
  138. mulsd %xmm0, %xmm2
  139. addsd .L_2il0floatpacket.15(%rip), %xmm4
  140. addsd .L_2il0floatpacket.20(%rip), %xmm2
  141. mulsd %xmm0, %xmm4
  142. mulsd %xmm0, %xmm2
  143. addsd .L_2il0floatpacket.16(%rip), %xmm4
  144. addsd .L_2il0floatpacket.21(%rip), %xmm2
  145. mulsd %xmm0, %xmm4
  146. mulsd %xmm1, %xmm2
  147. addsd %xmm2, %xmm4
  148. mulsd %xmm3, %xmm4
  149. addsd %xmm3, %xmm4
  150. ..B1.13:
  151. cvtsd2ss %xmm4, %xmm4
  152. movaps %xmm4, %xmm0
  153. ret
  154. ..B1.14:
  155. pxor %xmm5, %xmm5
  156. movq $0x3ff0000000000000, %rax
  157. cvtss2sd -8(%rsp), %xmm5
  158. andps .L_2il0floatpacket.29(%rip), %xmm5
  159. mulsd .L_2il0floatpacket.0(%rip), %xmm5
  160. movsd .L_2il0floatpacket.1(%rip), %xmm0
  161. movsd .L_2il0floatpacket.8(%rip), %xmm7
  162. addsd %xmm5, %xmm0
  163. cvtsd2ss %xmm0, %xmm0
  164. movss %xmm0, -16(%rsp)
  165. movss -16(%rsp), %xmm1
  166. movsd .L_2il0floatpacket.4(%rip), %xmm8
  167. movsd .L_2il0floatpacket.6(%rip), %xmm2
  168. movsd .L_2il0floatpacket.10(%rip), %xmm6
  169. movsd .L_2il0floatpacket.30(%rip), %xmm9
  170. movl -16(%rsp), %edx
  171. shlq $52, %rdx
  172. subss .L_2il0floatpacket.2(%rip), %xmm1
  173. cvtss2sd %xmm1, %xmm1
  174. addq %rax, %rdx
  175. subsd %xmm1, %xmm5
  176. movaps %xmm5, %xmm3
  177. mulsd %xmm5, %xmm3
  178. movaps %xmm3, %xmm4
  179. mulsd %xmm3, %xmm4
  180. mulsd %xmm4, %xmm7
  181. mulsd %xmm4, %xmm8
  182. mulsd %xmm4, %xmm2
  183. addsd .L_2il0floatpacket.9(%rip), %xmm7
  184. mulsd %xmm4, %xmm6
  185. addsd .L_2il0floatpacket.5(%rip), %xmm8
  186. addsd .L_2il0floatpacket.7(%rip), %xmm2
  187. mulsd %xmm3, %xmm7
  188. addsd .L_2il0floatpacket.11(%rip), %xmm6
  189. mulsd %xmm4, %xmm8
  190. mulsd %xmm3, %xmm2
  191. mulsd %xmm5, %xmm7
  192. mulsd %xmm5, %xmm6
  193. addsd %xmm2, %xmm8
  194. addsd %xmm6, %xmm7
  195. movq %rdx, -24(%rsp)
  196. addsd %xmm7, %xmm8
  197. movsd .L_2il0floatpacket.3(%rip), %xmm10
  198. addsd %xmm9, %xmm8
  199. mulsd -24(%rsp), %xmm8
  200. testl $-2147483648, -8(%rsp)
  201. addsd %xmm9, %xmm8
  202. divsd %xmm8, %xmm10
  203. subsd %xmm10, %xmm9
  204. movaps %xmm9, %xmm0
  205. xorps .L_2il0floatpacket.31(%rip), %xmm0
  206. jne ..L3
  207. movaps %xmm9, %xmm0
  208. ..L3:
  209. cvtsd2ss %xmm0, %xmm0
  210. ret
  211. ..B1.15:
  212. shrl $31, %edx
  213. cmpl $2139095040, %eax
  214. jb ..B1.20
  215. ..B1.16:
  216. jne ..B1.18
  217. ..B1.17:
  218. movl %edx, %edx
  219. lea ones(%rip), %rax
  220. movss (%rax,%rdx,4), %xmm0
  221. ret
  222. ..B1.18:
  223. movss -8(%rsp), %xmm0
  224. ..B1.19:
  225. ret
  226. ..B1.20:
  227. lea ones(%rip), %rax
  228. lea _small_value_32(%rip), %rcx
  229. movss (%rax,%rdx,4), %xmm0
  230. subss (%rcx,%rdx,4), %xmm0
  231. ret
  232. .align 16,0x90
  233. .cfi_endproc
  234. .type tanhf,@function
  235. .size tanhf,.-tanhf
  236. .data
  237. # -- End tanhf
  238. .section .rodata, "a"
  239. .align 16
  240. .align 16
  241. .L_2il0floatpacket.29:
  242. .long 0xffffffff,0x7fffffff,0x00000000,0x00000000
  243. .type .L_2il0floatpacket.29,@object
  244. .size .L_2il0floatpacket.29,16
  245. .align 16
  246. .L_2il0floatpacket.31:
  247. .long 0x00000000,0x80000000,0x00000000,0x00000000
  248. .type .L_2il0floatpacket.31,@object
  249. .size .L_2il0floatpacket.31,16
  250. .align 8
  251. .L_2il0floatpacket.0:
  252. .long 0x652b82fe,0x40071547
  253. .type .L_2il0floatpacket.0,@object
  254. .size .L_2il0floatpacket.0,8
  255. .align 8
  256. .L_2il0floatpacket.1:
  257. .long 0x00000000,0x41600000
  258. .type .L_2il0floatpacket.1,@object
  259. .size .L_2il0floatpacket.1,8
  260. .align 8
  261. .L_2il0floatpacket.3:
  262. .long 0x00000000,0x40000000
  263. .type .L_2il0floatpacket.3,@object
  264. .size .L_2il0floatpacket.3,8
  265. .align 8
  266. .L_2il0floatpacket.4:
  267. .long 0x55f6ce44,0x3eb67839
  268. .type .L_2il0floatpacket.4,@object
  269. .size .L_2il0floatpacket.4,8
  270. .align 8
  271. .L_2il0floatpacket.5:
  272. .long 0x17eb7c1b,0x3f83b2ac
  273. .type .L_2il0floatpacket.5,@object
  274. .size .L_2il0floatpacket.5,8
  275. .align 8
  276. .L_2il0floatpacket.6:
  277. .long 0x5a9238ae,0x3f24300f
  278. .type .L_2il0floatpacket.6,@object
  279. .size .L_2il0floatpacket.6,8
  280. .align 8
  281. .L_2il0floatpacket.7:
  282. .long 0xfe8df8b5,0x3fcebfbd
  283. .type .L_2il0floatpacket.7,@object
  284. .size .L_2il0floatpacket.7,8
  285. .align 8
  286. .L_2il0floatpacket.8:
  287. .long 0x97a846d7,0x3ef0355a
  288. .type .L_2il0floatpacket.8,@object
  289. .size .L_2il0floatpacket.8,8
  290. .align 8
  291. .L_2il0floatpacket.9:
  292. .long 0xb399a1da,0x3fac6b09
  293. .type .L_2il0floatpacket.9,@object
  294. .size .L_2il0floatpacket.9,8
  295. .align 8
  296. .L_2il0floatpacket.10:
  297. .long 0x2d719ac7,0x3f55d7f6
  298. .type .L_2il0floatpacket.10,@object
  299. .size .L_2il0floatpacket.10,8
  300. .align 8
  301. .L_2il0floatpacket.11:
  302. .long 0xfe8bdf78,0x3fe62e42
  303. .type .L_2il0floatpacket.11,@object
  304. .size .L_2il0floatpacket.11,8
  305. .align 8
  306. .L_2il0floatpacket.12:
  307. .long 0x8d21df9d,0x3eed02fa
  308. .type .L_2il0floatpacket.12,@object
  309. .size .L_2il0floatpacket.12,8
  310. .align 8
  311. .L_2il0floatpacket.13:
  312. .long 0x4a9bd1ce,0x3f3d92d7
  313. .type .L_2il0floatpacket.13,@object
  314. .size .L_2il0floatpacket.13,8
  315. .align 8
  316. .L_2il0floatpacket.14:
  317. .long 0x4b00cfe8,0x3f6d0411
  318. .type .L_2il0floatpacket.14,@object
  319. .size .L_2il0floatpacket.14,8
  320. .align 8
  321. .L_2il0floatpacket.15:
  322. .long 0x616f3508,0x3f96640f
  323. .type .L_2il0floatpacket.15,@object
  324. .size .L_2il0floatpacket.15,8
  325. .align 8
  326. .L_2il0floatpacket.16:
  327. .long 0xd4e5c3b2,0x3fc11110
  328. .type .L_2il0floatpacket.16,@object
  329. .size .L_2il0floatpacket.16,8
  330. .align 8
  331. .L_2il0floatpacket.17:
  332. .long 0x112b299f,0xbf1cd749
  333. .type .L_2il0floatpacket.17,@object
  334. .size .L_2il0floatpacket.17,8
  335. .align 8
  336. .L_2il0floatpacket.18:
  337. .long 0x6388aa74,0xbf563031
  338. .type .L_2il0floatpacket.18,@object
  339. .size .L_2il0floatpacket.18,8
  340. .align 8
  341. .L_2il0floatpacket.19:
  342. .long 0xd81e0536,0xbf821e4b
  343. .type .L_2il0floatpacket.19,@object
  344. .size .L_2il0floatpacket.19,8
  345. .align 8
  346. .L_2il0floatpacket.20:
  347. .long 0xdc3e3757,0xbfaba1ab
  348. .type .L_2il0floatpacket.20,@object
  349. .size .L_2il0floatpacket.20,8
  350. .align 8
  351. .L_2il0floatpacket.21:
  352. .long 0x547e4ef2,0xbfd55555
  353. .type .L_2il0floatpacket.21,@object
  354. .size .L_2il0floatpacket.21,8
  355. .align 8
  356. .L_2il0floatpacket.22:
  357. .long 0x7be81b29,0x3f6ab4a5
  358. .type .L_2il0floatpacket.22,@object
  359. .size .L_2il0floatpacket.22,8
  360. .align 8
  361. .L_2il0floatpacket.23:
  362. .long 0x9dbd8fad,0x3f966488
  363. .type .L_2il0floatpacket.23,@object
  364. .size .L_2il0floatpacket.23,8
  365. .align 8
  366. .L_2il0floatpacket.24:
  367. .long 0x0f94d287,0x3fc11111
  368. .type .L_2il0floatpacket.24,@object
  369. .size .L_2il0floatpacket.24,8
  370. .align 8
  371. .L_2il0floatpacket.25:
  372. .long 0xa5e0a14a,0xbf821629
  373. .type .L_2il0floatpacket.25,@object
  374. .size .L_2il0floatpacket.25,8
  375. .align 8
  376. .L_2il0floatpacket.26:
  377. .long 0x983e34ea,0xbfaba1b8
  378. .type .L_2il0floatpacket.26,@object
  379. .size .L_2il0floatpacket.26,8
  380. .align 8
  381. .L_2il0floatpacket.27:
  382. .long 0x5553e1cf,0xbfd55555
  383. .type .L_2il0floatpacket.27,@object
  384. .size .L_2il0floatpacket.27,8
  385. .align 8
  386. .L_2il0floatpacket.30:
  387. .long 0x00000000,0x3ff00000
  388. .type .L_2il0floatpacket.30,@object
  389. .size .L_2il0floatpacket.30,8
  390. .align 4
  391. .L_2il0floatpacket.2:
  392. .long 0x4b000000
  393. .type .L_2il0floatpacket.2,@object
  394. .size .L_2il0floatpacket.2,4
  395. .align 4
  396. .L_2il0floatpacket.28:
  397. .long 0x0d800000
  398. .type .L_2il0floatpacket.28,@object
  399. .size .L_2il0floatpacket.28,4
  400. .align 4
  401. _small_value_32:
  402. .long 226492416
  403. .long 2373976064
  404. .type _small_value_32,@object
  405. .size _small_value_32,8
  406. .align 4
  407. ones:
  408. .long 0x3f800000
  409. .long 0xbf800000
  410. .type ones,@object
  411. .size ones,8
  412. .data
  413. .section .note.GNU-stack, ""
  414. // -- Begin DWARF2 SEGMENT .eh_frame
  415. .section .eh_frame,"a",@progbits
  416. .eh_frame_seg:
  417. .align 1
  418. # End