frexpl.S 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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 "frexpl.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin frexpl
  41. .text
  42. .align 16,0x90
  43. .globl frexpl
  44. frexpl:
  45. # parameter 1: 32 + %rsp
  46. # parameter 2: %rdi
  47. ..B1.1:
  48. .cfi_startproc
  49. ..___tag_value_frexpl.1:
  50. ..L2:
  51. subq $24, %rsp
  52. .cfi_def_cfa_offset 32
  53. ..B1.2:
  54. fnstcw 18(%rsp)
  55. ..B1.3:
  56. movzwl 40(%rsp), %edx
  57. movl %edx, %eax
  58. andl $32767, %eax
  59. cmpl $32767, %eax
  60. je ..B1.15
  61. ..B1.4:
  62. testl %eax, %eax
  63. jne ..B1.13
  64. ..B1.5:
  65. cmpq $0, 32(%rsp)
  66. je ..B1.12
  67. ..B1.6:
  68. movzwl 18(%rsp), %edx
  69. movl %edx, %eax
  70. andl $768, %eax
  71. cmpl $768, %eax
  72. je ..B1.14
  73. ..B1.7:
  74. orl $-64768, %edx
  75. movl $0, (%rdi)
  76. movw %dx, 16(%rsp)
  77. ..B1.8:
  78. fldcw 16(%rsp)
  79. ..B1.9:
  80. fldt 32(%rsp)
  81. lea _TWO_75(%rip), %rax
  82. fmull (%rax)
  83. fstpt 32(%rsp)
  84. ..B1.10:
  85. fldcw 18(%rsp)
  86. ..B1.11:
  87. movzwl 40(%rsp), %edx
  88. movl %edx, %eax
  89. andl $-32768, %edx
  90. andl $32767, %eax
  91. orl $-49154, %edx
  92. addl $-16457, %eax
  93. movw %dx, 40(%rsp)
  94. fldt 32(%rsp)
  95. movl %eax, (%rdi)
  96. addq $24, %rsp
  97. .cfi_def_cfa_offset 8
  98. ret
  99. .cfi_def_cfa_offset 32
  100. ..B1.12:
  101. fldt 32(%rsp)
  102. movl $0, (%rdi)
  103. addq $24, %rsp
  104. .cfi_def_cfa_offset 8
  105. ret
  106. .cfi_def_cfa_offset 32
  107. ..B1.13:
  108. andl $-32768, %edx
  109. addl $-16382, %eax
  110. orl $-49154, %edx
  111. movw %dx, 40(%rsp)
  112. fldt 32(%rsp)
  113. movl %eax, (%rdi)
  114. addq $24, %rsp
  115. .cfi_def_cfa_offset 8
  116. ret
  117. .cfi_def_cfa_offset 32
  118. ..B1.14:
  119. fldt 32(%rsp)
  120. lea _TWO_75(%rip), %rax
  121. fmull (%rax)
  122. fstpt 32(%rsp)
  123. jmp ..B1.11
  124. ..B1.15:
  125. movzwl 18(%rsp), %edx
  126. movl %edx, %eax
  127. andl $768, %eax
  128. movl $0, (%rdi)
  129. cmpl $768, %eax
  130. je ..B1.21
  131. ..B1.16:
  132. orl $-64768, %edx
  133. movw %dx, 16(%rsp)
  134. ..B1.17:
  135. fldcw 16(%rsp)
  136. ..B1.18:
  137. fldt 32(%rsp)
  138. fstpt (%rsp)
  139. ..B1.19:
  140. fldcw 18(%rsp)
  141. ..B1.20:
  142. fldt (%rsp)
  143. addq $24, %rsp
  144. .cfi_def_cfa_offset 8
  145. ret
  146. .cfi_def_cfa_offset 32
  147. ..B1.21:
  148. fldt 32(%rsp)
  149. fstpt (%rsp)
  150. jmp ..B1.20
  151. .align 16,0x90
  152. .cfi_endproc
  153. .type frexpl,@function
  154. .size frexpl,.-frexpl
  155. .data
  156. # -- End frexpl
  157. .section .rodata, "a"
  158. .align 4
  159. .align 4
  160. _TWO_75:
  161. .long 0
  162. .long 1151336448
  163. .long 0
  164. .long 994050048
  165. .type _TWO_75,@object
  166. .size _TWO_75,16
  167. .data
  168. .section .note.GNU-stack, ""
  169. // -- Begin DWARF2 SEGMENT .eh_frame
  170. .section .eh_frame,"a",@progbits
  171. .eh_frame_seg:
  172. .align 1
  173. # End