fmodf.S 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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 "fmodf.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin fmodf
  41. .text
  42. .align 16,0x90
  43. .globl fmodf
  44. fmodf:
  45. # parameter 1: 16 + %esp
  46. # parameter 2: 20 + %esp
  47. ..B1.1:
  48. ..L1:
  49. subl $12, %esp
  50. movzwl 22(%esp), %ecx
  51. andl $32640, %ecx
  52. shrl $7, %ecx
  53. call ..L2
  54. ..L2:
  55. popl %eax
  56. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%eax), %eax
  57. testl %ecx, %ecx
  58. jne ..B1.3
  59. ..B1.2:
  60. testl $8388607, 20(%esp)
  61. je ..B1.8
  62. ..B1.3:
  63. movzwl 18(%esp), %edx
  64. andl $32640, %edx
  65. shrl $7, %edx
  66. cmpl $255, %edx
  67. je ..B1.22
  68. ..B1.4:
  69. cmpl $255, %ecx
  70. je ..B1.12
  71. ..B1.6:
  72. flds 20(%esp)
  73. flds 16(%esp)
  74. .L_2TAG_PACKET_0.0.2:
  75. fprem
  76. fstsw %ax
  77. sahf
  78. jp .L_2TAG_PACKET_0.0.2
  79. fstp %st(1)
  80. fstps (%esp)
  81. ..B1.7:
  82. flds (%esp)
  83. addl $12, %esp
  84. ret
  85. ..B1.8:
  86. movzwl 18(%esp), %edx
  87. andl $32640, %edx
  88. cmpl $32640, %edx
  89. jne ..B1.11
  90. ..B1.9:
  91. testl $8388607, 16(%esp)
  92. je ..B1.11
  93. ..B1.10:
  94. flds 16(%esp)
  95. fadds 20(%esp)
  96. addl $12, %esp
  97. ret
  98. ..B1.11:
  99. fldz
  100. fmuls .L_2il0floatpacket.0@GOTOFF(%eax)
  101. fsts (%esp)
  102. addl $12, %esp
  103. ret
  104. ..B1.12:
  105. testl $8388607, 20(%esp)
  106. jne ..B1.16
  107. ..B1.13:
  108. cmpl $255, %edx
  109. je ..B1.20
  110. ..B1.14:
  111. cmpl $255, %ecx
  112. je ..B1.17
  113. jmp ..B1.6
  114. ..B1.16:
  115. flds 16(%esp)
  116. fadds 20(%esp)
  117. addl $12, %esp
  118. ret
  119. ..B1.17:
  120. testl $8388607, 20(%esp)
  121. jne ..B1.6
  122. ..B1.18:
  123. flds 16(%esp)
  124. addl $12, %esp
  125. ret
  126. ..B1.20:
  127. testl $8388607, 16(%esp)
  128. jne ..B1.14
  129. ..B1.21:
  130. fldz
  131. fmuls .L_2il0floatpacket.0@GOTOFF(%eax)
  132. addl $12, %esp
  133. ret
  134. ..B1.22:
  135. testl $8388607, 16(%esp)
  136. jne ..B1.16
  137. ..B1.23:
  138. cmpl $255, %ecx
  139. je ..B1.12
  140. jmp ..B1.13
  141. .align 16,0x90
  142. .type fmodf,@function
  143. .size fmodf,.-fmodf
  144. .data
  145. # -- End fmodf
  146. .section .rodata, "a"
  147. .align 4
  148. .align 4
  149. .L_2il0floatpacket.0:
  150. .long 0x7f800000
  151. .type .L_2il0floatpacket.0,@object
  152. .size .L_2il0floatpacket.0,4
  153. .data
  154. .section .note.GNU-stack, ""
  155. # End