log10f_gen.S 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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 "log10f_gen.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin log10f
  41. .text
  42. .align 16,0x90
  43. .globl log10f
  44. log10f:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_log10f.1:
  49. ..L2:
  50. movd %xmm0, %edi
  51. movss %xmm0, -8(%rsp)
  52. cmpl $2139095040, %edi
  53. jae ..B1.14
  54. ..B1.2:
  55. lea -1065222144(%rdi), %eax
  56. cmpl $196608, %eax
  57. jae ..B1.7
  58. ..B1.3:
  59. cmpl $1065353216, %edi
  60. jne ..B1.5
  61. ..B1.4:
  62. pxor %xmm3, %xmm3
  63. jmp ..B1.6
  64. ..B1.5:
  65. movss -8(%rsp), %xmm0
  66. lea 40+_Q(%rip), %rax
  67. lea 32+_Q(%rip), %rsi
  68. addss .L_2il0floatpacket.0(%rip), %xmm0
  69. cvtss2sd %xmm0, %xmm0
  70. movaps %xmm0, %xmm1
  71. lea 24+_Q(%rip), %rdx
  72. movsd (%rax), %xmm3
  73. lea 16+_Q(%rip), %rdi
  74. movsd (%rsi), %xmm2
  75. lea 8+_Q(%rip), %rcx
  76. lea _Q(%rip), %r8
  77. mulsd %xmm0, %xmm1
  78. mulsd %xmm1, %xmm3
  79. mulsd %xmm1, %xmm2
  80. addsd (%rdx), %xmm3
  81. addsd (%rdi), %xmm2
  82. mulsd %xmm1, %xmm3
  83. mulsd %xmm1, %xmm2
  84. addsd (%rcx), %xmm3
  85. addsd (%r8), %xmm2
  86. mulsd %xmm1, %xmm3
  87. mulsd %xmm0, %xmm2
  88. addsd %xmm2, %xmm3
  89. cvtsd2ss %xmm3, %xmm3
  90. ..B1.6:
  91. movaps %xmm3, %xmm0
  92. ret
  93. ..B1.7:
  94. movl %edi, %eax
  95. movl %edi, %esi
  96. shrl $23, %eax
  97. andl $8388607, %esi
  98. addl $-127, %eax
  99. movl %esi, -8(%rsp)
  100. cmpl $8388608, %edi
  101. jae ..B1.10
  102. ..B1.8:
  103. testl %edi, %edi
  104. je ..B1.22
  105. ..B1.9:
  106. movss -8(%rsp), %xmm0
  107. mulss .L_2il0floatpacket.1(%rip), %xmm0
  108. movd %xmm0, %esi
  109. movss %xmm0, -8(%rsp)
  110. movl %esi, %eax
  111. movl %esi, %edi
  112. shrl $23, %eax
  113. addl $-152, %eax
  114. ..B1.10:
  115. imull $21846, %eax, %edx
  116. sarl $15, %edx
  117. cmpl $34, %eax
  118. ja ..B1.13
  119. ..B1.11:
  120. andl $-2, %edx
  121. lea _exact_values(%rip), %rcx
  122. movslq %edx, %rdx
  123. cmpl (%rcx,%rdx,4), %edi
  124. jne ..B1.13
  125. ..B1.12:
  126. movss 4(%rcx,%rdx,4), %xmm0
  127. ret
  128. ..B1.13:
  129. shrl $15, %edi
  130. orl $1065353216, %esi
  131. movzbl %dil, %r8d
  132. pxor %xmm2, %xmm2
  133. movl %esi, -8(%rsp)
  134. pxor %xmm0, %xmm0
  135. movq __libm_rcp_table_256@GOTPCREL(%rip), %rsi
  136. lea 16+_P(%rip), %rdx
  137. cvtss2sd -8(%rsp), %xmm2
  138. cvtss2sd (%rsi,%r8,4), %xmm0
  139. mulsd %xmm0, %xmm2
  140. lea 8+_P(%rip), %rcx
  141. movsd (%rdx), %xmm0
  142. lea _P(%rip), %r9
  143. movq __libm_logf_table_256@GOTPCREL(%rip), %rdi
  144. pxor %xmm3, %xmm3
  145. cvtsi2sd %eax, %xmm3
  146. addsd .L_2il0floatpacket.2(%rip), %xmm2
  147. mulsd %xmm2, %xmm0
  148. lea _LOG102(%rip), %rax
  149. mulsd (%rax), %xmm3
  150. addsd (%rcx), %xmm0
  151. mulsd %xmm2, %xmm0
  152. movsd (%rdi,%r8,8), %xmm1
  153. mulsd %xmm2, %xmm0
  154. addsd %xmm1, %xmm2
  155. mulsd (%r9), %xmm2
  156. addsd %xmm2, %xmm0
  157. addsd %xmm3, %xmm0
  158. cvtsd2ss %xmm0, %xmm0
  159. ret
  160. ..B1.14:
  161. movl %edi, %eax
  162. andl $2147483647, %eax
  163. cmpl $2139095040, %eax
  164. ja ..B1.20
  165. ..B1.15:
  166. testl $-2147483648, %edi
  167. je ..B1.20
  168. ..B1.16:
  169. testl %eax, %eax
  170. jne ..B1.18
  171. ..B1.17:
  172. movss .L_2il0floatpacket.0(%rip), %xmm0
  173. pxor %xmm1, %xmm1
  174. divss %xmm1, %xmm0
  175. ret
  176. ..B1.18:
  177. movss .L_2il0floatpacket.3(%rip), %xmm1
  178. pxor %xmm0, %xmm0
  179. mulss %xmm1, %xmm0
  180. ..B1.19:
  181. ret
  182. ..B1.20:
  183. movss -8(%rsp), %xmm0
  184. ret
  185. ..B1.22:
  186. movss .L_2il0floatpacket.0(%rip), %xmm0
  187. pxor %xmm1, %xmm1
  188. divss %xmm1, %xmm0
  189. ret
  190. .align 16,0x90
  191. .cfi_endproc
  192. .type log10f,@function
  193. .size log10f,.-log10f
  194. .data
  195. # -- End log10f
  196. .section .rodata, "a"
  197. .align 8
  198. .align 8
  199. .L_2il0floatpacket.2:
  200. .long 0x00000000,0xbff00000
  201. .type .L_2il0floatpacket.2,@object
  202. .size .L_2il0floatpacket.2,8
  203. .align 4
  204. .L_2il0floatpacket.0:
  205. .long 0xbf800000
  206. .type .L_2il0floatpacket.0,@object
  207. .size .L_2il0floatpacket.0,4
  208. .align 4
  209. .L_2il0floatpacket.1:
  210. .long 0x4c000000
  211. .type .L_2il0floatpacket.1,@object
  212. .size .L_2il0floatpacket.1,4
  213. .align 4
  214. .L_2il0floatpacket.3:
  215. .long 0x7f800000
  216. .type .L_2il0floatpacket.3,@object
  217. .size .L_2il0floatpacket.3,4
  218. .align 4
  219. _Q:
  220. .long 354870542
  221. .long 1071369083
  222. .long 354784454
  223. .long 3217804155
  224. .long 1678399179
  225. .long 1069713319
  226. .long 656012052
  227. .long 3216755581
  228. .long 509767151
  229. .long 1068907598
  230. .long 3001134819
  231. .long 3216124527
  232. .type _Q,@object
  233. .size _Q,48
  234. .align 4
  235. _exact_values:
  236. .long 4294967295
  237. .long 4294967295
  238. .long 1092616192
  239. .long 1065353216
  240. .long 1120403456
  241. .long 1073741824
  242. .long 1148846080
  243. .long 1077936128
  244. .long 1176256512
  245. .long 1082130432
  246. .long 1203982336
  247. .long 1084227584
  248. .long 1232348160
  249. .long 1086324736
  250. .long 1259902592
  251. .long 1088421888
  252. .long 1287568416
  253. .long 1090519040
  254. .long 1315859240
  255. .long 1091567616
  256. .long 4294967295
  257. .long 4294967295
  258. .long 1343554297
  259. .long 1092616192
  260. .type _exact_values,@object
  261. .size _exact_values,96
  262. .align 4
  263. _P:
  264. .long 354870542
  265. .long 1071369083
  266. .long 1669757279
  267. .long 3217804158
  268. .long 3421439185
  269. .long 1069713323
  270. .type _P,@object
  271. .size _P,24
  272. .align 4
  273. _LOG102:
  274. .long 1352628735
  275. .long 1070810131
  276. .type _LOG102,@object
  277. .size _LOG102,8
  278. .data
  279. .section .note.GNU-stack, ""
  280. // -- Begin DWARF2 SEGMENT .eh_frame
  281. .section .eh_frame,"a",@progbits
  282. .eh_frame_seg:
  283. .align 1
  284. # End