cbrtl.S 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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 "cbrtl.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin cbrtl
  41. .text
  42. .align 16,0x90
  43. .globl cbrtl
  44. cbrtl:
  45. # parameter 1: 8 + %ebp
  46. ..B1.1:
  47. ..L1:
  48. pushl %ebp
  49. movl %esp, %ebp
  50. andl $-16, %esp
  51. pushl %esi
  52. pushl %edi
  53. pushl %ebx
  54. subl $36, %esp
  55. ..B1.2:
  56. fnstcw 30(%esp)
  57. ..B1.3:
  58. movzwl 16(%ebp), %esi
  59. movl %esi, %ebx
  60. andl $32767, %ebx
  61. movzwl 30(%esp), %ecx
  62. cmpl $32767, %ebx
  63. je ..B1.23
  64. ..B1.4:
  65. movl %ecx, %edx
  66. movzbl 17(%ebp), %eax
  67. andl $768, %edx
  68. andl $128, %eax
  69. shrl $7, %eax
  70. cmpl $768, %edx
  71. je ..B1.22
  72. ..B1.5:
  73. orl $-64768, %ecx
  74. movw %cx, 28(%esp)
  75. ..B1.6:
  76. fldcw 28(%esp)
  77. ..B1.7:
  78. movzwl 16(%ebp), %esi
  79. movl %esi, %ebx
  80. movl $1, %edi
  81. andl $32767, %ebx
  82. ..B1.8:
  83. call ..L2
  84. ..L2:
  85. popl %ecx
  86. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%ecx), %ecx
  87. testl %ebx, %ebx
  88. jne ..B1.15
  89. ..B1.9:
  90. cmpl $0, 12(%ebp)
  91. jne ..B1.14
  92. ..B1.10:
  93. cmpl $0, 8(%ebp)
  94. jne ..B1.14
  95. ..B1.11:
  96. fldl _zeros@GOTOFF(%ecx,%eax,8)
  97. testl %edi, %edi
  98. fstpl (%esp)
  99. je ..B1.13
  100. ..B1.12:
  101. fldcw 30(%esp)
  102. ..B1.13:
  103. fldl (%esp)
  104. addl $36, %esp
  105. popl %ebx
  106. popl %edi
  107. popl %esi
  108. movl %ebp, %esp
  109. popl %ebp
  110. ret
  111. ..B1.14:
  112. fldt 8(%ebp)
  113. movl $-25, %edx
  114. fmull _TWO_75@GOTOFF(%ecx)
  115. fstpt 8(%ebp)
  116. movzwl 16(%ebp), %esi
  117. movl %esi, %ebx
  118. andl $32767, %ebx
  119. jmp ..B1.16
  120. ..B1.15:
  121. xorl %edx, %edx
  122. ..B1.16:
  123. fldl ones@GOTOFF(%ecx,%eax,8)
  124. andl $-32768, %esi
  125. imull $21845, %ebx, %eax
  126. orl $-49153, %esi
  127. fstpt (%esp)
  128. fldt (%esp)
  129. fldl _TWO_32H@GOTOFF(%ecx)
  130. fld %st(0)
  131. fldt .L_2il0floatpacket.0@GOTOFF(%ecx)
  132. movw %si, 16(%ebp)
  133. addl $21845, %eax
  134. fldt 8(%ebp)
  135. fmulp %st, %st(4)
  136. shrl $16, %eax
  137. fxch %st(1)
  138. fadd %st(3), %st
  139. movl %edi, 12(%esp)
  140. lea (%eax,%eax), %edi
  141. subl %edi, %ebx
  142. lea 10922(%edx,%eax), %edx
  143. movl 12(%ebp), %edi
  144. fsubp %st, %st(2)
  145. shrl $23, %edi
  146. fxch %st(1)
  147. fsubr %st, %st(2)
  148. fldt 72+_P@GOTOFF(%ecx)
  149. fldt 48+_P@GOTOFF(%ecx)
  150. andl $255, %edi
  151. movzwl 8(%esp), %esi
  152. andl $-32768, %esi
  153. orl %edx, %esi
  154. flds __libm_rcp_table_256@GOTOFF(%ecx,%edi,4)
  155. fld %st(0)
  156. fmulp %st, %st(4)
  157. shll $4, %edi
  158. fxch %st(3)
  159. fsub %st(4), %st
  160. fxch %st(3)
  161. fmulp %st, %st(5)
  162. movw %si, 8(%esp)
  163. subl %eax, %ebx
  164. fxch %st(4)
  165. faddp %st, %st(2)
  166. fld %st(1)
  167. fmul %st(2), %st
  168. fmul %st, %st(1)
  169. fxch %st(4)
  170. faddp %st, %st(1)
  171. fmul %st(3), %st
  172. fxch %st(1)
  173. fstpt 8(%ebp)
  174. fldt 8(%ebp)
  175. fldt 24+_P@GOTOFF(%ecx)
  176. faddp %st, %st(2)
  177. fxch %st(1)
  178. fmul %st(3), %st
  179. fmul %st(1), %st
  180. fldt 60+_P@GOTOFF(%ecx)
  181. fmul %st(4), %st
  182. fldt 36+_P@GOTOFF(%ecx)
  183. faddp %st, %st(1)
  184. fmul %st(4), %st
  185. fldt 12+_P@GOTOFF(%ecx)
  186. faddp %st, %st(1)
  187. fmulp %st, %st(4)
  188. faddp %st, %st(3)
  189. fldt _P@GOTOFF(%ecx)
  190. fmulp %st, %st(1)
  191. faddp %st, %st(2)
  192. fadd %st(1), %st
  193. fstpt 16(%esp)
  194. fldl 8+__libm_cbrtl_table_256@GOTOFF(%ecx,%edi)
  195. fldl __libm_cbrtl_table_256@GOTOFF(%ecx,%edi)
  196. fldt (%esp)
  197. movl 12(%esp), %edi
  198. jne ..B1.18
  199. ..B1.17:
  200. fldt 16(%esp)
  201. fmulp %st, %st(3)
  202. fxch %st(1)
  203. fmul %st, %st(3)
  204. fxch %st(3)
  205. faddp %st, %st(2)
  206. fxch %st(2)
  207. faddp %st, %st(1)
  208. fmulp %st, %st(1)
  209. fstpt 16(%esp)
  210. jmp ..B1.19
  211. ..B1.18:
  212. fxch %st(2)
  213. fmull -8+_SH@GOTOFF(%ecx,%ebx,8)
  214. fldl 24+_SH@GOTOFF(%ecx,%ebx,8)
  215. fmul %st(2), %st
  216. faddp %st, %st(1)
  217. fxch %st(1)
  218. fmull 8+_SH@GOTOFF(%ecx,%ebx,8)
  219. fmul %st, %st(3)
  220. fldt 16(%esp)
  221. fmulp %st, %st(2)
  222. fxch %st(3)
  223. faddp %st, %st(1)
  224. faddp %st, %st(2)
  225. fmulp %st, %st(1)
  226. fstpt 16(%esp)
  227. ..B1.19:
  228. testl %edi, %edi
  229. je ..B1.21
  230. ..B1.20:
  231. fldcw 30(%esp)
  232. ..B1.21:
  233. fldt 16(%esp)
  234. addl $36, %esp
  235. popl %ebx
  236. popl %edi
  237. popl %esi
  238. movl %ebp, %esp
  239. popl %ebp
  240. ret
  241. ..B1.22:
  242. xorl %edi, %edi
  243. jmp ..B1.8
  244. ..B1.23:
  245. movl %ecx, %eax
  246. andl $768, %eax
  247. cmpl $768, %eax
  248. je ..B1.29
  249. ..B1.24:
  250. orl $-64768, %ecx
  251. movw %cx, 28(%esp)
  252. ..B1.25:
  253. fldcw 28(%esp)
  254. ..B1.26:
  255. fldt 8(%ebp)
  256. fstpt (%esp)
  257. ..B1.27:
  258. fldcw 30(%esp)
  259. ..B1.28:
  260. fldt (%esp)
  261. addl $36, %esp
  262. popl %ebx
  263. popl %edi
  264. popl %esi
  265. movl %ebp, %esp
  266. popl %ebp
  267. ret
  268. ..B1.29:
  269. fldt 8(%ebp)
  270. fstpt (%esp)
  271. jmp ..B1.28
  272. .align 16,0x90
  273. .type cbrtl,@function
  274. .size cbrtl,.-cbrtl
  275. .data
  276. # -- End cbrtl
  277. .section .rodata, "a"
  278. .align 16
  279. .align 16
  280. .L_2il0floatpacket.0:
  281. .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x3f,0x00,0x00
  282. .type .L_2il0floatpacket.0,@object
  283. .size .L_2il0floatpacket.0,12
  284. .space 4, 0x00 # pad
  285. .align 8
  286. ones:
  287. .long 0x00000000,0x3ff00000
  288. .long 0x00000000,0xbff00000
  289. .type ones,@object
  290. .size ones,16
  291. .align 8
  292. _SH:
  293. .long 0xf98d728b,0x3ff428a2
  294. .long 0xa53d6e3d,0x3ff965fe
  295. .long 0xf8000000,0x3ff428a2
  296. .long 0xa4000000,0x3ff965fe
  297. .long 0xae223ddb,0x3e38d728
  298. .long 0xc82b059a,0x3e33d6e3
  299. .type _SH,@object
  300. .size _SH,48
  301. .align 4
  302. _zeros:
  303. .long 0
  304. .long 0
  305. .long 0
  306. .long 2147483648
  307. .type _zeros,@object
  308. .size _zeros,16
  309. .align 4
  310. _TWO_75:
  311. .long 0
  312. .long 1151336448
  313. .long 0
  314. .long 994050048
  315. .type _TWO_75,@object
  316. .size _TWO_75,16
  317. .align 4
  318. _TWO_32H:
  319. .long 0
  320. .long 1106771968
  321. .type _TWO_32H,@object
  322. .size _TWO_32H,8
  323. .align 2
  324. _P:
  325. .word 43691
  326. .word 43690
  327. .word 43690
  328. .word 43690
  329. .word 16381
  330. .word 0
  331. .word 58320
  332. .word 36408
  333. .word 14563
  334. .word 58254
  335. .word 49147
  336. .word 0
  337. .word 50474
  338. .word 25890
  339. .word 59872
  340. .word 64726
  341. .word 16378
  342. .word 0
  343. .word 45217
  344. .word 37017
  345. .word 18069
  346. .word 43151
  347. .word 49146
  348. .word 0
  349. .word 45059
  350. .word 7616
  351. .word 35240
  352. .word 63288
  353. .word 16377
  354. .word 0
  355. .word 54522
  356. .word 17175
  357. .word 48475
  358. .word 49224
  359. .word 49145
  360. .word 0
  361. .word 568
  362. .word 55426
  363. .word 44619
  364. .word 39848
  365. .word 16377
  366. .word 0
  367. .type _P,@object
  368. .size _P,84
  369. .data
  370. .hidden __libm_rcp_table_256
  371. .hidden __libm_cbrtl_table_256
  372. .section .note.GNU-stack, ""
  373. # End