scalblnf.S 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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 "scalblnf.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin scalblnf
  41. .text
  42. .align 16,0x90
  43. .globl scalblnf
  44. scalblnf:
  45. # parameter 1: %xmm0
  46. # parameter 2: %rdi
  47. ..B1.1:
  48. .cfi_startproc
  49. ..___tag_value_scalblnf.1:
  50. ..L2:
  51. movq %rdi, %r8
  52. movss %xmm0, -8(%rsp)
  53. movzwl -6(%rsp), %eax
  54. movl %eax, %esi
  55. andl $32640, %esi
  56. shrl $7, %esi
  57. cmpl $255, %esi
  58. je ..B1.9
  59. ..B1.2:
  60. xorb %dil, %dil
  61. testl %esi, %esi
  62. jne ..B1.5
  63. ..B1.3:
  64. testl $8388607, -8(%rsp)
  65. je ..B1.9
  66. ..B1.4:
  67. movss -8(%rsp), %xmm0
  68. movb $1, %dil
  69. mulss .L_2il0floatpacket.0(%rip), %xmm0
  70. movss %xmm0, -8(%rsp)
  71. movzwl -6(%rsp), %eax
  72. movl %eax, %esi
  73. andl $32640, %esi
  74. shrl $7, %esi
  75. addl $-25, %esi
  76. ..B1.5:
  77. movl $65536, %edx
  78. cmpq $65536, %r8
  79. cmovg %rdx, %r8
  80. movq $-65536, %rcx
  81. cmpq $-65536, %r8
  82. movslq %esi, %rsi
  83. cmovl %rcx, %r8
  84. addq %r8, %rsi
  85. testl %esi, %esi
  86. jle ..B1.11
  87. ..B1.6:
  88. cmpl $255, %esi
  89. jge ..B1.10
  90. ..B1.7:
  91. movzbl %sil, %esi
  92. andl $-32641, %eax
  93. shll $7, %esi
  94. orl %esi, %eax
  95. movw %ax, -6(%rsp)
  96. movss -8(%rsp), %xmm0
  97. ..B1.8:
  98. ret
  99. ..B1.9:
  100. movss -8(%rsp), %xmm0
  101. ret
  102. ..B1.10:
  103. movb -5(%rsp), %al
  104. lea _large_value_32(%rip), %rdx
  105. andb $-128, %al
  106. shrb $7, %al
  107. movzbl %al, %ecx
  108. movss (%rdx,%rcx,4), %xmm0
  109. mulss .L_2il0floatpacket.1(%rip), %xmm0
  110. ret
  111. ..B1.11:
  112. cmpl $-23, %esi
  113. jl ..B1.15
  114. ..B1.12:
  115. addl $25, %esi
  116. andl $-32641, %eax
  117. movzbl %sil, %esi
  118. shll $7, %esi
  119. orl %esi, %eax
  120. movw %ax, -6(%rsp)
  121. testb %dil, %dil
  122. movss -8(%rsp), %xmm0
  123. mulss .L_2il0floatpacket.3(%rip), %xmm0
  124. je ..B1.14
  125. ..B1.13:
  126. testq %r8, %r8
  127. jl ..B1.8
  128. ..B1.14:
  129. ret
  130. ..B1.15:
  131. movb -5(%rsp), %al
  132. lea _small_value_32(%rip), %rdx
  133. andb $-128, %al
  134. shrb $7, %al
  135. movzbl %al, %ecx
  136. movss (%rdx,%rcx,4), %xmm0
  137. mulss .L_2il0floatpacket.2(%rip), %xmm0
  138. ret
  139. .align 16,0x90
  140. .cfi_endproc
  141. .type scalblnf,@function
  142. .size scalblnf,.-scalblnf
  143. .data
  144. # -- End scalblnf
  145. .section .rodata, "a"
  146. .align 4
  147. .align 4
  148. .L_2il0floatpacket.0:
  149. .long 0x4c000000
  150. .type .L_2il0floatpacket.0,@object
  151. .size .L_2il0floatpacket.0,4
  152. .align 4
  153. .L_2il0floatpacket.1:
  154. .long 0x71800000
  155. .type .L_2il0floatpacket.1,@object
  156. .size .L_2il0floatpacket.1,4
  157. .align 4
  158. .L_2il0floatpacket.2:
  159. .long 0x0d800000
  160. .type .L_2il0floatpacket.2,@object
  161. .size .L_2il0floatpacket.2,4
  162. .align 4
  163. .L_2il0floatpacket.3:
  164. .long 0x33000000
  165. .type .L_2il0floatpacket.3,@object
  166. .size .L_2il0floatpacket.3,4
  167. .align 4
  168. _large_value_32:
  169. .long 1904214016
  170. .long 4051697664
  171. .type _large_value_32,@object
  172. .size _large_value_32,8
  173. .align 4
  174. _small_value_32:
  175. .long 226492416
  176. .long 2373976064
  177. .type _small_value_32,@object
  178. .size _small_value_32,8
  179. .data
  180. .section .note.GNU-stack, ""
  181. // -- Begin DWARF2 SEGMENT .eh_frame
  182. .section .eh_frame,"a",@progbits
  183. .eh_frame_seg:
  184. .align 1
  185. # End