coshf_gen.S 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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 "coshf_gen.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin coshf
  41. .text
  42. .align 16,0x90
  43. .globl coshf
  44. coshf:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_coshf.1:
  49. ..L2:
  50. movd %xmm0, %eax
  51. movss %xmm0, -8(%rsp)
  52. andl $2147483647, %eax
  53. cmpl $1107296256, %eax
  54. jae ..B1.10
  55. ..B1.2:
  56. cmpl $1056964608, %eax
  57. jae ..B1.9
  58. ..B1.3:
  59. cmpl $1031798784, %eax
  60. jae ..B1.8
  61. ..B1.4:
  62. cmpl $838860800, %eax
  63. jae ..B1.6
  64. ..B1.5:
  65. andps .L_2il0floatpacket.15(%rip), %xmm0
  66. addss .L_2il0floatpacket.16(%rip), %xmm0
  67. movss %xmm0, -16(%rsp)
  68. ret
  69. ..B1.6:
  70. pxor %xmm0, %xmm0
  71. cvtss2sd -8(%rsp), %xmm0
  72. mulsd %xmm0, %xmm0
  73. movsd .L_2il0floatpacket.13(%rip), %xmm1
  74. mulsd %xmm0, %xmm1
  75. addsd .L_2il0floatpacket.14(%rip), %xmm1
  76. mulsd %xmm0, %xmm1
  77. pxor %xmm0, %xmm0
  78. addsd .L_2il0floatpacket.17(%rip), %xmm1
  79. cvtsd2ss %xmm1, %xmm0
  80. ..B1.7:
  81. ret
  82. ..B1.8:
  83. pxor %xmm1, %xmm1
  84. cvtss2sd -8(%rsp), %xmm1
  85. mulsd %xmm1, %xmm1
  86. movaps %xmm1, %xmm0
  87. mulsd %xmm1, %xmm0
  88. movsd .L_2il0floatpacket.8(%rip), %xmm3
  89. movsd .L_2il0floatpacket.10(%rip), %xmm2
  90. mulsd %xmm0, %xmm3
  91. mulsd %xmm0, %xmm2
  92. addsd .L_2il0floatpacket.9(%rip), %xmm3
  93. addsd .L_2il0floatpacket.11(%rip), %xmm2
  94. mulsd %xmm0, %xmm3
  95. mulsd %xmm1, %xmm2
  96. addsd %xmm2, %xmm3
  97. addsd .L_2il0floatpacket.17(%rip), %xmm3
  98. cvtsd2ss %xmm3, %xmm3
  99. movaps %xmm3, %xmm0
  100. ret
  101. ..B1.9:
  102. pxor %xmm3, %xmm3
  103. pxor %xmm4, %xmm4
  104. cvtss2sd -8(%rsp), %xmm3
  105. andps .L_2il0floatpacket.18(%rip), %xmm3
  106. pxor %xmm6, %xmm6
  107. movsd .L_2il0floatpacket.0(%rip), %xmm0
  108. mulsd %xmm3, %xmm0
  109. movsd .L_2il0floatpacket.4(%rip), %xmm7
  110. movsd .L_2il0floatpacket.6(%rip), %xmm5
  111. movq __libm_expf_table_64@GOTPCREL(%rip), %rsi
  112. addsd .L_2il0floatpacket.1(%rip), %xmm0
  113. cvtsd2ss %xmm0, %xmm0
  114. movss %xmm0, -16(%rsp)
  115. movss -16(%rsp), %xmm1
  116. movl -16(%rsp), %ecx
  117. movl %ecx, %eax
  118. shll $26, %eax
  119. subss .L_2il0floatpacket.2(%rip), %xmm1
  120. cvtss2sd %xmm1, %xmm1
  121. mulsd .L_2il0floatpacket.3(%rip), %xmm1
  122. sarl $26, %eax
  123. addsd %xmm1, %xmm3
  124. movaps %xmm3, %xmm2
  125. mulsd %xmm3, %xmm2
  126. mulsd %xmm2, %xmm7
  127. mulsd %xmm2, %xmm5
  128. addsd .L_2il0floatpacket.5(%rip), %xmm7
  129. addsd .L_2il0floatpacket.7(%rip), %xmm5
  130. mulsd %xmm2, %xmm7
  131. mulsd %xmm3, %xmm5
  132. addsd .L_2il0floatpacket.17(%rip), %xmm7
  133. movslq %eax, %rax
  134. movaps %xmm7, %xmm0
  135. subl %eax, %ecx
  136. addsd %xmm5, %xmm0
  137. subsd %xmm5, %xmm7
  138. shrl $6, %ecx
  139. shlq $3, %rax
  140. shll $23, %ecx
  141. mulsd 256(%rsi,%rax), %xmm0
  142. negq %rax
  143. mulsd 256(%rsi,%rax), %xmm7
  144. lea 1056964608(%rcx), %edx
  145. negl %ecx
  146. addl $1056964608, %ecx
  147. movl %edx, -24(%rsp)
  148. movl %ecx, -20(%rsp)
  149. cvtss2sd -24(%rsp), %xmm4
  150. cvtss2sd -20(%rsp), %xmm6
  151. mulsd %xmm4, %xmm0
  152. mulsd %xmm6, %xmm7
  153. addsd %xmm7, %xmm0
  154. cvtsd2ss %xmm0, %xmm0
  155. ret
  156. ..B1.10:
  157. cmpl $1119016188, %eax
  158. jbe ..B1.14
  159. ..B1.11:
  160. cmpl $2139095040, %eax
  161. jb ..B1.15
  162. ..B1.12:
  163. movss -8(%rsp), %xmm0
  164. mulss %xmm0, %xmm0
  165. ..B1.13:
  166. ret
  167. ..B1.14:
  168. pxor %xmm3, %xmm3
  169. cvtss2sd -8(%rsp), %xmm3
  170. andps .L_2il0floatpacket.18(%rip), %xmm3
  171. movsd .L_2il0floatpacket.0(%rip), %xmm0
  172. mulsd %xmm3, %xmm0
  173. movsd .L_2il0floatpacket.6(%rip), %xmm4
  174. movq __libm_expf_table_64@GOTPCREL(%rip), %rcx
  175. movl $0, -24(%rsp)
  176. addsd .L_2il0floatpacket.1(%rip), %xmm0
  177. cvtsd2ss %xmm0, %xmm0
  178. movss %xmm0, -16(%rsp)
  179. movss -16(%rsp), %xmm1
  180. movsd .L_2il0floatpacket.4(%rip), %xmm0
  181. movl -16(%rsp), %eax
  182. movl %eax, %edx
  183. shll $26, %edx
  184. subss .L_2il0floatpacket.2(%rip), %xmm1
  185. cvtss2sd %xmm1, %xmm1
  186. mulsd .L_2il0floatpacket.3(%rip), %xmm1
  187. sarl $26, %edx
  188. addsd %xmm1, %xmm3
  189. movaps %xmm3, %xmm2
  190. subl %edx, %eax
  191. mulsd %xmm3, %xmm2
  192. mulsd %xmm2, %xmm0
  193. mulsd %xmm2, %xmm4
  194. addsd .L_2il0floatpacket.5(%rip), %xmm0
  195. addsd .L_2il0floatpacket.7(%rip), %xmm4
  196. mulsd %xmm2, %xmm0
  197. mulsd %xmm3, %xmm4
  198. movslq %edx, %rdx
  199. addsd %xmm4, %xmm0
  200. shrl $6, %eax
  201. addsd .L_2il0floatpacket.17(%rip), %xmm0
  202. mulsd 256(%rcx,%rdx,8), %xmm0
  203. shll $20, %eax
  204. addl $1071644672, %eax
  205. movl %eax, -20(%rsp)
  206. mulsd -24(%rsp), %xmm0
  207. cvtsd2ss %xmm0, %xmm0
  208. ret
  209. ..B1.15:
  210. movss .L_2il0floatpacket.12(%rip), %xmm0
  211. mulss %xmm0, %xmm0
  212. ret
  213. .align 16,0x90
  214. .cfi_endproc
  215. .type coshf,@function
  216. .size coshf,.-coshf
  217. .data
  218. # -- End coshf
  219. .section .rodata, "a"
  220. .align 16
  221. .align 16
  222. .L_2il0floatpacket.15:
  223. .long 0x7fffffff,0x00000000,0x00000000,0x00000000
  224. .type .L_2il0floatpacket.15,@object
  225. .size .L_2il0floatpacket.15,16
  226. .align 16
  227. .L_2il0floatpacket.18:
  228. .long 0xffffffff,0x7fffffff,0x00000000,0x00000000
  229. .type .L_2il0floatpacket.18,@object
  230. .size .L_2il0floatpacket.18,16
  231. .align 8
  232. .L_2il0floatpacket.0:
  233. .long 0x652b82fe,0x40571547
  234. .type .L_2il0floatpacket.0,@object
  235. .size .L_2il0floatpacket.0,8
  236. .align 8
  237. .L_2il0floatpacket.1:
  238. .long 0x00000000,0x41680000
  239. .type .L_2il0floatpacket.1,@object
  240. .size .L_2il0floatpacket.1,8
  241. .align 8
  242. .L_2il0floatpacket.3:
  243. .long 0xfefa39ef,0xbf862e42
  244. .type .L_2il0floatpacket.3,@object
  245. .size .L_2il0floatpacket.3,8
  246. .align 8
  247. .L_2il0floatpacket.4:
  248. .long 0xeb78fa85,0x3fa56420
  249. .type .L_2il0floatpacket.4,@object
  250. .size .L_2il0floatpacket.4,8
  251. .align 8
  252. .L_2il0floatpacket.5:
  253. .long 0x008d6118,0x3fe00000
  254. .type .L_2il0floatpacket.5,@object
  255. .size .L_2il0floatpacket.5,8
  256. .align 8
  257. .L_2il0floatpacket.6:
  258. .long 0xda752d4f,0x3fc55550
  259. .type .L_2il0floatpacket.6,@object
  260. .size .L_2il0floatpacket.6,8
  261. .align 8
  262. .L_2il0floatpacket.7:
  263. .long 0xffffe7c6,0x3fefffff
  264. .type .L_2il0floatpacket.7,@object
  265. .size .L_2il0floatpacket.7,8
  266. .align 8
  267. .L_2il0floatpacket.8:
  268. .long 0xdcf5905b,0x3efa3001
  269. .type .L_2il0floatpacket.8,@object
  270. .size .L_2il0floatpacket.8,8
  271. .align 8
  272. .L_2il0floatpacket.9:
  273. .long 0x72601504,0x3fa55555
  274. .type .L_2il0floatpacket.9,@object
  275. .size .L_2il0floatpacket.9,8
  276. .align 8
  277. .L_2il0floatpacket.10:
  278. .long 0x7543543e,0x3f56c143
  279. .type .L_2il0floatpacket.10,@object
  280. .size .L_2il0floatpacket.10,8
  281. .align 8
  282. .L_2il0floatpacket.11:
  283. .long 0xffe2f097,0x3fdfffff
  284. .type .L_2il0floatpacket.11,@object
  285. .size .L_2il0floatpacket.11,8
  286. .align 8
  287. .L_2il0floatpacket.13:
  288. .long 0x6e6d0908,0x3fa55666
  289. .type .L_2il0floatpacket.13,@object
  290. .size .L_2il0floatpacket.13,8
  291. .align 8
  292. .L_2il0floatpacket.14:
  293. .long 0xf3327c54,0x3fdfffff
  294. .type .L_2il0floatpacket.14,@object
  295. .size .L_2il0floatpacket.14,8
  296. .align 8
  297. .L_2il0floatpacket.17:
  298. .long 0x00000000,0x3ff00000
  299. .type .L_2il0floatpacket.17,@object
  300. .size .L_2il0floatpacket.17,8
  301. .align 4
  302. .L_2il0floatpacket.2:
  303. .long 0x4b400000
  304. .type .L_2il0floatpacket.2,@object
  305. .size .L_2il0floatpacket.2,4
  306. .align 4
  307. .L_2il0floatpacket.12:
  308. .long 0x71800000
  309. .type .L_2il0floatpacket.12,@object
  310. .size .L_2il0floatpacket.12,4
  311. .align 4
  312. .L_2il0floatpacket.16:
  313. .long 0x3f800000
  314. .type .L_2il0floatpacket.16,@object
  315. .size .L_2il0floatpacket.16,4
  316. .data
  317. .section .note.GNU-stack, ""
  318. // -- Begin DWARF2 SEGMENT .eh_frame
  319. .section .eh_frame,"a",@progbits
  320. .eh_frame_seg:
  321. .align 1
  322. # End