logf_gen.S 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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 "logf_gen.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin logf
  41. .text
  42. .align 16,0x90
  43. .globl logf
  44. logf:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_logf.1:
  49. ..L2:
  50. movd %xmm0, %edx
  51. movss %xmm0, -8(%rsp)
  52. cmpl $2139095040, %edx
  53. jae ..B1.11
  54. ..B1.2:
  55. lea -1065091072(%rdx), %eax
  56. cmpl $524288, %eax
  57. jae ..B1.7
  58. ..B1.3:
  59. cmpl $1065353216, %edx
  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 32+_Q(%rip), %rax
  67. lea 24+_Q(%rip), %rcx
  68. addss .L_2il0floatpacket.0(%rip), %xmm0
  69. cvtss2sd %xmm0, %xmm0
  70. movaps %xmm0, %xmm2
  71. lea 16+_Q(%rip), %rdx
  72. movsd (%rax), %xmm3
  73. lea 8+_Q(%rip), %rsi
  74. movsd (%rcx), %xmm1
  75. lea _Q(%rip), %rdi
  76. mulsd %xmm0, %xmm2
  77. mulsd %xmm2, %xmm3
  78. mulsd %xmm2, %xmm1
  79. addsd (%rdx), %xmm3
  80. addsd (%rsi), %xmm1
  81. mulsd %xmm2, %xmm3
  82. mulsd %xmm0, %xmm1
  83. addsd %xmm1, %xmm3
  84. addsd (%rdi), %xmm3
  85. mulsd %xmm2, %xmm3
  86. addsd %xmm0, %xmm3
  87. cvtsd2ss %xmm3, %xmm3
  88. ..B1.6:
  89. movaps %xmm3, %xmm0
  90. ret
  91. ..B1.7:
  92. movl %edx, %esi
  93. movl %edx, %eax
  94. shrl $23, %esi
  95. andl $8388607, %eax
  96. addl $-127, %esi
  97. cmpl $8388608, %edx
  98. jae ..B1.10
  99. ..B1.8:
  100. movl %eax, -8(%rsp)
  101. testl %edx, %edx
  102. je ..B1.19
  103. ..B1.9:
  104. movss -8(%rsp), %xmm0
  105. mulss .L_2il0floatpacket.2(%rip), %xmm0
  106. movd %xmm0, %eax
  107. movss %xmm0, -8(%rsp)
  108. movl %eax, %esi
  109. movl %eax, %edx
  110. shrl $23, %esi
  111. addl $-152, %esi
  112. ..B1.10:
  113. shrl $15, %edx
  114. orl $1065353216, %eax
  115. movzbl %dl, %r8d
  116. pxor %xmm1, %xmm1
  117. movl %eax, -8(%rsp)
  118. pxor %xmm0, %xmm0
  119. movq __libm_rcp_table_256@GOTPCREL(%rip), %rax
  120. lea 8+_P(%rip), %rdx
  121. cvtss2sd -8(%rsp), %xmm1
  122. cvtss2sd (%rax,%r8,4), %xmm0
  123. mulsd %xmm0, %xmm1
  124. lea _P(%rip), %rcx
  125. movsd (%rdx), %xmm0
  126. pxor %xmm2, %xmm2
  127. cvtsi2sd %esi, %xmm2
  128. addsd .L_2il0floatpacket.1(%rip), %xmm1
  129. mulsd %xmm1, %xmm0
  130. lea _LN2(%rip), %rsi
  131. mulsd (%rsi), %xmm2
  132. addsd (%rcx), %xmm0
  133. mulsd %xmm1, %xmm0
  134. mulsd %xmm1, %xmm0
  135. movq __libm_logf_table_256@GOTPCREL(%rip), %rdi
  136. addsd %xmm1, %xmm0
  137. addsd (%rdi,%r8,8), %xmm2
  138. addsd %xmm2, %xmm0
  139. cvtsd2ss %xmm0, %xmm0
  140. ret
  141. ..B1.11:
  142. movl %edx, %eax
  143. andl $2147483647, %eax
  144. cmpl $2139095040, %eax
  145. ja ..B1.17
  146. ..B1.12:
  147. testl $-2147483648, %edx
  148. je ..B1.17
  149. ..B1.13:
  150. testl %eax, %eax
  151. jne ..B1.15
  152. ..B1.14:
  153. movss .L_2il0floatpacket.0(%rip), %xmm0
  154. pxor %xmm1, %xmm1
  155. divss %xmm1, %xmm0
  156. ret
  157. ..B1.15:
  158. movss .L_2il0floatpacket.3(%rip), %xmm1
  159. pxor %xmm0, %xmm0
  160. mulss %xmm1, %xmm0
  161. ..B1.16:
  162. ret
  163. ..B1.17:
  164. movss -8(%rsp), %xmm0
  165. ret
  166. ..B1.19:
  167. movss .L_2il0floatpacket.0(%rip), %xmm0
  168. pxor %xmm1, %xmm1
  169. divss %xmm1, %xmm0
  170. ret
  171. .align 16,0x90
  172. .cfi_endproc
  173. .type logf,@function
  174. .size logf,.-logf
  175. .data
  176. # -- End logf
  177. .section .rodata, "a"
  178. .align 8
  179. .align 8
  180. .L_2il0floatpacket.1:
  181. .long 0x00000000,0xbff00000
  182. .type .L_2il0floatpacket.1,@object
  183. .size .L_2il0floatpacket.1,8
  184. .align 4
  185. .L_2il0floatpacket.0:
  186. .long 0xbf800000
  187. .type .L_2il0floatpacket.0,@object
  188. .size .L_2il0floatpacket.0,4
  189. .align 4
  190. .L_2il0floatpacket.2:
  191. .long 0x4c000000
  192. .type .L_2il0floatpacket.2,@object
  193. .size .L_2il0floatpacket.2,4
  194. .align 4
  195. .L_2il0floatpacket.3:
  196. .long 0x7f800000
  197. .type .L_2il0floatpacket.3,@object
  198. .size .L_2il0floatpacket.3,4
  199. .align 4
  200. _Q:
  201. .long 4294868184
  202. .long 3219128319
  203. .long 1443356411
  204. .long 1070945621
  205. .long 823147527
  206. .long 3218079745
  207. .long 748089218
  208. .long 1070176642
  209. .long 1053536005
  210. .long 3217353219
  211. .type _Q,@object
  212. .size _Q,40
  213. .align 4
  214. _P:
  215. .long 3879088107
  216. .long 3219128321
  217. .long 1754324240
  218. .long 1070945626
  219. .type _P,@object
  220. .size _P,16
  221. .align 4
  222. _LN2:
  223. .long 4277811695
  224. .long 1072049730
  225. .type _LN2,@object
  226. .size _LN2,8
  227. .data
  228. .section .note.GNU-stack, ""
  229. // -- Begin DWARF2 SEGMENT .eh_frame
  230. .section .eh_frame,"a",@progbits
  231. .eh_frame_seg:
  232. .align 1
  233. # End