log2f_gen.S 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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 "log2f_gen.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin log2f
  41. .text
  42. .align 16,0x90
  43. .globl log2f
  44. log2f:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_log2f.1:
  49. ..L2:
  50. movd %xmm0, %edx
  51. movss %xmm0, -8(%rsp)
  52. cmpl $2139095040, %edx
  53. jae ..B1.14
  54. ..B1.2:
  55. lea -1065222144(%rdx), %eax
  56. cmpl $196608, %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 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 %edx, %r9d
  95. movl %edx, %eax
  96. shrl $23, %r9d
  97. andl $8388607, %eax
  98. addl $-127, %r9d
  99. movl %eax, -8(%rsp)
  100. cmpl $8388608, %edx
  101. jae ..B1.10
  102. ..B1.8:
  103. testl %edx, %edx
  104. je ..B1.22
  105. ..B1.9:
  106. movss -8(%rsp), %xmm0
  107. mulss .L_2il0floatpacket.1(%rip), %xmm0
  108. movd %xmm0, %eax
  109. movss %xmm0, -8(%rsp)
  110. movl %eax, %r9d
  111. movl %eax, %edx
  112. shrl $23, %r9d
  113. addl $-152, %r9d
  114. ..B1.10:
  115. testl $8388607, %edx
  116. jne ..B1.12
  117. ..B1.11:
  118. pxor %xmm0, %xmm0
  119. cvtsi2ss %r9d, %xmm0
  120. ret
  121. ..B1.12:
  122. shrl $15, %edx
  123. orl $1065353216, %eax
  124. movzbl %dl, %edi
  125. pxor %xmm2, %xmm2
  126. movl %eax, -8(%rsp)
  127. pxor %xmm0, %xmm0
  128. movq __libm_rcp_table_256@GOTPCREL(%rip), %rax
  129. lea 16+_P(%rip), %rdx
  130. lea 8+_P(%rip), %rcx
  131. lea _P(%rip), %r8
  132. movq __libm_logf_table_256@GOTPCREL(%rip), %rsi
  133. pxor %xmm3, %xmm3
  134. cvtss2sd -8(%rsp), %xmm2
  135. cvtss2sd (%rax,%rdi,4), %xmm0
  136. cvtsi2sd %r9d, %xmm3
  137. mulsd %xmm0, %xmm2
  138. movsd (%rdx), %xmm0
  139. movsd (%rsi,%rdi,8), %xmm1
  140. addsd .L_2il0floatpacket.2(%rip), %xmm2
  141. mulsd %xmm2, %xmm0
  142. addsd (%rcx), %xmm0
  143. mulsd %xmm2, %xmm0
  144. mulsd %xmm2, %xmm0
  145. addsd %xmm1, %xmm2
  146. mulsd (%r8), %xmm2
  147. addsd %xmm2, %xmm0
  148. addsd %xmm3, %xmm0
  149. cvtsd2ss %xmm0, %xmm0
  150. ..B1.13:
  151. ret
  152. ..B1.14:
  153. movl %edx, %eax
  154. andl $2147483647, %eax
  155. cmpl $2139095040, %eax
  156. ja ..B1.20
  157. ..B1.15:
  158. testl $-2147483648, %edx
  159. je ..B1.20
  160. ..B1.16:
  161. testl %eax, %eax
  162. jne ..B1.18
  163. ..B1.17:
  164. movss .L_2il0floatpacket.0(%rip), %xmm0
  165. pxor %xmm1, %xmm1
  166. divss %xmm1, %xmm0
  167. ret
  168. ..B1.18:
  169. movss .L_2il0floatpacket.3(%rip), %xmm1
  170. pxor %xmm0, %xmm0
  171. mulss %xmm1, %xmm0
  172. ..B1.19:
  173. ret
  174. ..B1.20:
  175. movss -8(%rsp), %xmm0
  176. ret
  177. ..B1.22:
  178. movss .L_2il0floatpacket.0(%rip), %xmm0
  179. pxor %xmm1, %xmm1
  180. divss %xmm1, %xmm0
  181. ret
  182. .align 16,0x90
  183. .cfi_endproc
  184. .type log2f,@function
  185. .size log2f,.-log2f
  186. .data
  187. # -- End log2f
  188. .section .rodata, "a"
  189. .align 8
  190. .align 8
  191. .L_2il0floatpacket.2:
  192. .long 0x00000000,0xbff00000
  193. .type .L_2il0floatpacket.2,@object
  194. .size .L_2il0floatpacket.2,8
  195. .align 4
  196. .L_2il0floatpacket.0:
  197. .long 0xbf800000
  198. .type .L_2il0floatpacket.0,@object
  199. .size .L_2il0floatpacket.0,4
  200. .align 4
  201. .L_2il0floatpacket.1:
  202. .long 0x4c000000
  203. .type .L_2il0floatpacket.1,@object
  204. .size .L_2il0floatpacket.1,4
  205. .align 4
  206. .L_2il0floatpacket.3:
  207. .long 0x7f800000
  208. .type .L_2il0floatpacket.3,@object
  209. .size .L_2il0floatpacket.3,4
  210. .align 4
  211. _Q:
  212. .long 1697350398
  213. .long 1073157447
  214. .long 1697278904
  215. .long 3219592519
  216. .long 3711670093
  217. .long 1071564553
  218. .long 491294680
  219. .long 3218543945
  220. .long 1795286032
  221. .long 1070757723
  222. .long 557036084
  223. .long 3217959989
  224. .type _Q,@object
  225. .size _Q,48
  226. .align 4
  227. _P:
  228. .long 1697350398
  229. .long 1073157447
  230. .long 605117704
  231. .long 3219592522
  232. .long 782203563
  233. .long 1071564561
  234. .type _P,@object
  235. .size _P,24
  236. .data
  237. .section .note.GNU-stack, ""
  238. // -- Begin DWARF2 SEGMENT .eh_frame
  239. .section .eh_frame,"a",@progbits
  240. .eh_frame_seg:
  241. .align 1
  242. # End