fmod_gen.S 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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 "fmod_gen.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin fmod
  41. .text
  42. .align 16,0x90
  43. .globl fmod
  44. fmod:
  45. # parameter 1: %xmm0
  46. # parameter 2: %xmm1
  47. ..B1.1:
  48. .cfi_startproc
  49. ..___tag_value_fmod.1:
  50. ..L2:
  51. subq $40, %rsp
  52. .cfi_def_cfa_offset 48
  53. movq $0x8000000000000000, %rsi
  54. movd %xmm1, %rcx
  55. movq $0x7fffffffffffffff, %rdi
  56. movd %xmm0, %rax
  57. movsd %xmm0, 16(%rsp)
  58. movsd %xmm1, 24(%rsp)
  59. btrq $63, %rcx
  60. movq $0x3ff0000000000000, %rdx
  61. andq %rax, %rsi
  62. andq %rax, %rdi
  63. cmpq %rdx, %rcx
  64. jne ..B1.30
  65. ..B1.2:
  66. cmpq %rcx, %rdi
  67. ja ..B1.7
  68. ..B1.3:
  69. jne ..B1.6
  70. ..B1.4:
  71. pxor %xmm1, %xmm1
  72. mulsd %xmm1, %xmm0
  73. ..B1.6:
  74. addq $40, %rsp
  75. .cfi_def_cfa_offset 8
  76. ret
  77. .cfi_def_cfa_offset 48
  78. ..B1.7:
  79. movq $0x4330000000000000, %rax
  80. cmpq %rax, %rdi
  81. jae ..B1.9
  82. ..B1.8:
  83. negq %rcx
  84. addq %rdi, %rcx
  85. shrq $52, %rcx
  86. negq %rcx
  87. addq $52, %rcx
  88. movsd 16(%rsp), %xmm0
  89. shrq %cl, %rdi
  90. shlq %cl, %rdi
  91. orq %rsi, %rdi
  92. movq %rdi, (%rsp)
  93. subsd (%rsp), %xmm0
  94. movd %xmm0, %rax
  95. orq %rsi, %rax
  96. movq %rax, (%rsp)
  97. movsd (%rsp), %xmm0
  98. movsd %xmm0, 8(%rsp)
  99. addq $40, %rsp
  100. .cfi_def_cfa_offset 8
  101. ret
  102. .cfi_def_cfa_offset 48
  103. ..B1.9:
  104. movq $0x7ff0000000000000, %rax
  105. cmpq %rax, %rdi
  106. jae ..B1.11
  107. ..B1.10:
  108. pxor %xmm0, %xmm0
  109. mulsd 16(%rsp), %xmm0
  110. movsd %xmm0, 8(%rsp)
  111. addq $40, %rsp
  112. .cfi_def_cfa_offset 8
  113. ret
  114. .cfi_def_cfa_offset 48
  115. ..B1.30:
  116. movq $0x7ff0000000000000, %rax
  117. cmpq %rax, %rdi
  118. ..B1.11:
  119. ja ..B1.25
  120. ..B1.12:
  121. cmpq %rax, %rcx
  122. ja ..B1.24
  123. ..B1.13:
  124. testq %rcx, %rcx
  125. je ..B1.23
  126. ..B1.14:
  127. cmpq %rax, %rdi
  128. je ..B1.23
  129. ..B1.15:
  130. cmpq %rax, %rcx
  131. je ..B1.22
  132. ..B1.16:
  133. cmpq %rcx, %rdi
  134. jb ..B1.21
  135. ..B1.17:
  136. je ..B1.27
  137. ..B1.18:
  138. movq %rdi, (%rsp)
  139. ..B1.19:
  140. fldl 24(%rsp)
  141. fldl 16(%rsp)
  142. .L_2TAG_PACKET_0.0.2:
  143. fprem
  144. fstsw %ax
  145. andw $1024, %ax
  146. jne .L_2TAG_PACKET_0.0.2
  147. fstp %st(1)
  148. fstpl 8(%rsp)
  149. ..B1.20:
  150. movsd 8(%rsp), %xmm0
  151. addq $40, %rsp
  152. .cfi_def_cfa_offset 8
  153. ret
  154. .cfi_def_cfa_offset 48
  155. ..B1.21:
  156. movsd 16(%rsp), %xmm0
  157. addq $40, %rsp
  158. .cfi_def_cfa_offset 8
  159. ret
  160. .cfi_def_cfa_offset 48
  161. ..B1.22:
  162. movsd 16(%rsp), %xmm0
  163. movsd %xmm0, 8(%rsp)
  164. addq $40, %rsp
  165. .cfi_def_cfa_offset 8
  166. ret
  167. .cfi_def_cfa_offset 48
  168. ..B1.23:
  169. pxor %xmm0, %xmm0
  170. pxor %xmm1, %xmm1
  171. divsd %xmm1, %xmm0
  172. movsd %xmm0, 8(%rsp)
  173. addq $40, %rsp
  174. .cfi_def_cfa_offset 8
  175. ret
  176. .cfi_def_cfa_offset 48
  177. ..B1.24:
  178. movsd 24(%rsp), %xmm0
  179. mulsd 16(%rsp), %xmm0
  180. movsd %xmm0, 8(%rsp)
  181. addq $40, %rsp
  182. .cfi_def_cfa_offset 8
  183. ret
  184. .cfi_def_cfa_offset 48
  185. ..B1.25:
  186. movsd 16(%rsp), %xmm0
  187. mulsd 24(%rsp), %xmm0
  188. movsd %xmm0, 8(%rsp)
  189. addq $40, %rsp
  190. .cfi_def_cfa_offset 8
  191. ret
  192. .cfi_def_cfa_offset 48
  193. ..B1.27:
  194. pxor %xmm0, %xmm0
  195. mulsd 16(%rsp), %xmm0
  196. addq $40, %rsp
  197. .cfi_def_cfa_offset 8
  198. ret
  199. .align 16,0x90
  200. .cfi_endproc
  201. .type fmod,@function
  202. .size fmod,.-fmod
  203. .data
  204. # -- End fmod
  205. .data
  206. .section .note.GNU-stack, ""
  207. // -- Begin DWARF2 SEGMENT .eh_frame
  208. .section .eh_frame,"a",@progbits
  209. .eh_frame_seg:
  210. .align 1
  211. # End