remainderf.S 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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 "remainderf.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin remainderf
  41. .text
  42. .align 16,0x90
  43. .globl remainderf
  44. remainderf:
  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. fprem1
  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. fsts (%esp)
  97. addl $12, %esp
  98. ret
  99. ..B1.11:
  100. fldz
  101. fmuls .L_2il0floatpacket.0@GOTOFF(%eax)
  102. fsts (%esp)
  103. addl $12, %esp
  104. ret
  105. ..B1.12:
  106. testl $8388607, 20(%esp)
  107. jne ..B1.16
  108. ..B1.13:
  109. cmpl $255, %edx
  110. je ..B1.20
  111. ..B1.14:
  112. cmpl $255, %ecx
  113. je ..B1.17
  114. jmp ..B1.6
  115. ..B1.16:
  116. flds 16(%esp)
  117. fadds 20(%esp)
  118. addl $12, %esp
  119. ret
  120. ..B1.17:
  121. testl $8388607, 20(%esp)
  122. jne ..B1.6
  123. ..B1.18:
  124. flds 16(%esp)
  125. addl $12, %esp
  126. ret
  127. ..B1.20:
  128. testl $8388607, 16(%esp)
  129. jne ..B1.14
  130. ..B1.21:
  131. fldz
  132. fmuls .L_2il0floatpacket.0@GOTOFF(%eax)
  133. addl $12, %esp
  134. ret
  135. ..B1.22:
  136. testl $8388607, 16(%esp)
  137. jne ..B1.16
  138. ..B1.23:
  139. cmpl $255, %ecx
  140. je ..B1.12
  141. jmp ..B1.13
  142. .align 16,0x90
  143. .type remainderf,@function
  144. .size remainderf,.-remainderf
  145. .data
  146. # -- End remainderf
  147. .section .rodata, "a"
  148. .align 4
  149. .align 4
  150. .L_2il0floatpacket.0:
  151. .long 0x7f800000
  152. .type .L_2il0floatpacket.0,@object
  153. .size .L_2il0floatpacket.0,4
  154. .data
  155. .section .note.GNU-stack, ""
  156. # End
  157. .globl dremf
  158. .equ dremf, remainderf