libm_log_k32.S 4.8 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. .globl __libm_log_k32
  44. __libm_log_k32:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value___libm_log_k32.1:
  49. ..L2:
  50. movsd %xmm0, -24(%rsp)
  51. movl -20(%rsp), %ecx
  52. movl %ecx, %eax
  53. andl $2146435072, %eax
  54. negl %eax
  55. lea -1072676864(%rcx), %edx
  56. addl $2145386496, %eax
  57. movl %eax, -12(%rsp)
  58. cmpl $24576, %edx
  59. movl $0, -16(%rsp)
  60. movsd .L_2il0floatpacket.0(%rip), %xmm1
  61. jae ..B1.3
  62. ..B1.2:
  63. lea 32+_Q(%rip), %rax
  64. addsd %xmm1, %xmm0
  65. movaps %xmm0, %xmm2
  66. lea 24+_Q(%rip), %rcx
  67. movsd (%rax), %xmm3
  68. lea 16+_Q(%rip), %rdx
  69. lea 8+_Q(%rip), %rsi
  70. lea _Q(%rip), %rdi
  71. movsd %xmm0, -24(%rsp)
  72. movsd (%rcx), %xmm1
  73. mulsd %xmm0, %xmm2
  74. mulsd %xmm2, %xmm3
  75. mulsd %xmm2, %xmm1
  76. addsd (%rdx), %xmm3
  77. addsd (%rsi), %xmm1
  78. mulsd %xmm2, %xmm3
  79. mulsd %xmm0, %xmm1
  80. addsd %xmm1, %xmm3
  81. addsd (%rdi), %xmm3
  82. mulsd %xmm2, %xmm3
  83. addsd %xmm3, %xmm0
  84. ret
  85. ..B1.3:
  86. movl %ecx, %esi
  87. pxor %xmm0, %xmm0
  88. shrl $12, %ecx
  89. lea 8+_P(%rip), %rax
  90. movzbl %cl, %r9d
  91. lea _P(%rip), %rdx
  92. movq __libm_rcp_table_256@GOTPCREL(%rip), %rcx
  93. lea _LN2(%rip), %rdi
  94. movsd -24(%rsp), %xmm2
  95. shrl $20, %esi
  96. addl $-1023, %esi
  97. cvtss2sd (%rcx,%r9,4), %xmm0
  98. mulsd -16(%rsp), %xmm2
  99. mulsd %xmm0, %xmm2
  100. movsd (%rax), %xmm0
  101. addsd %xmm1, %xmm2
  102. mulsd %xmm2, %xmm0
  103. pxor %xmm1, %xmm1
  104. cvtsi2sd %esi, %xmm1
  105. addsd (%rdx), %xmm0
  106. mulsd (%rdi), %xmm1
  107. mulsd %xmm2, %xmm0
  108. mulsd %xmm2, %xmm0
  109. movq __libm_logf_table_256@GOTPCREL(%rip), %r8
  110. addsd %xmm2, %xmm0
  111. addsd (%r8,%r9,8), %xmm1
  112. movsd %xmm2, -24(%rsp)
  113. addsd %xmm1, %xmm0
  114. ..B1.4:
  115. ret
  116. .align 16,0x90
  117. .cfi_endproc
  118. .type __libm_log_k32,@function
  119. .size __libm_log_k32,.-__libm_log_k32
  120. .data
  121. # -- End __libm_log_k32
  122. .section .rodata, "a"
  123. .align 8
  124. .align 8
  125. .L_2il0floatpacket.0:
  126. .long 0x00000000,0xbff00000
  127. .type .L_2il0floatpacket.0,@object
  128. .size .L_2il0floatpacket.0,8
  129. .align 4
  130. _Q:
  131. .long 4294868184
  132. .long 3219128319
  133. .long 1443356411
  134. .long 1070945621
  135. .long 823147527
  136. .long 3218079745
  137. .long 748089218
  138. .long 1070176642
  139. .long 1053536005
  140. .long 3217353219
  141. .type _Q,@object
  142. .size _Q,40
  143. .align 4
  144. _P:
  145. .long 3879088107
  146. .long 3219128321
  147. .long 1754324240
  148. .long 1070945626
  149. .type _P,@object
  150. .size _P,16
  151. .align 4
  152. _LN2:
  153. .long 4277811695
  154. .long 1072049730
  155. .type _LN2,@object
  156. .size _LN2,8
  157. .data
  158. .section .note.GNU-stack, ""
  159. // -- Begin DWARF2 SEGMENT .eh_frame
  160. .section .eh_frame,"a",@progbits
  161. .eh_frame_seg:
  162. .align 1
  163. # End