libm_log_k32.S 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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 "libm_log_k32.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin __libm_log_k32
  41. .text
  42. .align 16,0x90
  43. .hidden __libm_log_k32
  44. .globl __libm_log_k32
  45. __libm_log_k32:
  46. # parameter 1: 8 + %ebp
  47. ..B1.1:
  48. ..L1:
  49. pushl %ebp
  50. movl %esp, %ebp
  51. andl $-16, %esp
  52. subl $16, %esp
  53. movl 12(%ebp), %edx
  54. movl %edx, %eax
  55. call ..L2
  56. ..L2:
  57. popl %ecx
  58. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%ecx), %ecx
  59. andl $2146435072, %eax
  60. negl %eax
  61. addl $2145386496, %eax
  62. fldl .L_2il0floatpacket.0@GOTOFF(%ecx)
  63. movl %eax, 12(%esp)
  64. lea -1072676864(%edx), %eax
  65. movl $0, 8(%esp)
  66. cmpl $24576, %eax
  67. jae ..B1.3
  68. ..B1.2:
  69. fldl 8(%ebp)
  70. faddp %st, %st(1)
  71. fld %st(0)
  72. fmul %st(1), %st
  73. fxch %st(1)
  74. fstl 8(%ebp)
  75. fldl 32+_Q@GOTOFF(%ecx)
  76. fmul %st(2), %st
  77. fldl 24+_Q@GOTOFF(%ecx)
  78. fmul %st(3), %st
  79. fxch %st(1)
  80. faddl 16+_Q@GOTOFF(%ecx)
  81. fmul %st(3), %st
  82. fxch %st(1)
  83. faddl 8+_Q@GOTOFF(%ecx)
  84. fmul %st(2), %st
  85. faddp %st, %st(1)
  86. faddl _Q@GOTOFF(%ecx)
  87. fmulp %st, %st(2)
  88. faddp %st, %st(1)
  89. movl %ebp, %esp
  90. popl %ebp
  91. ret
  92. ..B1.3:
  93. fldl 8(%ebp)
  94. movl %edx, %eax
  95. fmull 8(%esp)
  96. shrl $12, %edx
  97. movzbl %dl, %edx
  98. shrl $20, %eax
  99. addl $-1023, %eax
  100. movl %eax, (%esp)
  101. fmuls __libm_rcp_table_256@GOTOFF(%ecx,%edx,4)
  102. faddp %st, %st(1)
  103. fstl 8(%ebp)
  104. fldl 8+_P@GOTOFF(%ecx)
  105. fmul %st(1), %st
  106. fildl (%esp)
  107. fxch %st(1)
  108. faddl _P@GOTOFF(%ecx)
  109. fmul %st(2), %st
  110. fmul %st(2), %st
  111. faddp %st, %st(2)
  112. fmull _LN2@GOTOFF(%ecx)
  113. faddl __libm_logf_table_256@GOTOFF(%ecx,%edx,8)
  114. faddp %st, %st(1)
  115. ..B1.4:
  116. movl %ebp, %esp
  117. popl %ebp
  118. ret
  119. .align 16,0x90
  120. .type __libm_log_k32,@function
  121. .size __libm_log_k32,.-__libm_log_k32
  122. .data
  123. # -- End __libm_log_k32
  124. .section .rodata, "a"
  125. .align 8
  126. .align 8
  127. .L_2il0floatpacket.0:
  128. .long 0x00000000,0xbff00000
  129. .type .L_2il0floatpacket.0,@object
  130. .size .L_2il0floatpacket.0,8
  131. .align 4
  132. _Q:
  133. .long 4294868184
  134. .long 3219128319
  135. .long 1443356411
  136. .long 1070945621
  137. .long 823147527
  138. .long 3218079745
  139. .long 748089218
  140. .long 1070176642
  141. .long 1053536005
  142. .long 3217353219
  143. .type _Q,@object
  144. .size _Q,40
  145. .align 4
  146. _P:
  147. .long 3879088107
  148. .long 3219128321
  149. .long 1754324240
  150. .long 1070945626
  151. .type _P,@object
  152. .size _P,16
  153. .align 4
  154. _LN2:
  155. .long 4277811695
  156. .long 1072049730
  157. .type _LN2,@object
  158. .size _LN2,8
  159. .data
  160. .hidden __libm_rcp_table_256
  161. .hidden __libm_logf_table_256
  162. .section .note.GNU-stack, ""
  163. # End