ashlsi3.S 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH GCC-exception-2.0
  2. Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
  3. 2004, 2005, 2006
  4. Free Software Foundation, Inc.
  5. */
  6. !! libgcc routines for the Renesas / SuperH SH CPUs.
  7. !! Contributed by Steve Chamberlain.
  8. !! [email protected]
  9. !! ashiftrt_r4_x, ___ashrsi3, ___ashlsi3, ___lshrsi3 routines
  10. !! recoded in assembly by Toshiyasu Morita
  11. !! [email protected]
  12. /* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
  13. ELF local label prefixes by J"orn Rennecke
  14. [email protected] */
  15. !
  16. ! __ashlsi3
  17. !
  18. ! Entry:
  19. !
  20. ! r4: Value to shift
  21. ! r5: Shifts
  22. !
  23. ! Exit:
  24. !
  25. ! r0: Result
  26. !
  27. ! Destroys:
  28. !
  29. ! (none)
  30. !
  31. ! __ashlsi3_r0
  32. !
  33. ! Entry:
  34. !
  35. ! r4: Value to shift
  36. ! r0: Shifts
  37. !
  38. ! Exit:
  39. !
  40. ! r0: Result
  41. !
  42. ! Destroys:
  43. !
  44. ! (none)
  45. .global __ashlsi3
  46. .global __ashlsi3_r0
  47. .align 2
  48. __ashlsi3:
  49. mov r5,r0
  50. .align 2
  51. __ashlsi3_r0:
  52. and #31,r0
  53. mov.l r4,@-r15
  54. mov r0,r4
  55. mova ashlsi3_table,r0
  56. mov.b @(r0,r4),r4
  57. add r4,r0
  58. jmp @r0
  59. mov.l @r15+,r0
  60. .align 2
  61. ashlsi3_table:
  62. .byte ashlsi3_0-ashlsi3_table
  63. .byte ashlsi3_1-ashlsi3_table
  64. .byte ashlsi3_2-ashlsi3_table
  65. .byte ashlsi3_3-ashlsi3_table
  66. .byte ashlsi3_4-ashlsi3_table
  67. .byte ashlsi3_5-ashlsi3_table
  68. .byte ashlsi3_6-ashlsi3_table
  69. .byte ashlsi3_7-ashlsi3_table
  70. .byte ashlsi3_8-ashlsi3_table
  71. .byte ashlsi3_9-ashlsi3_table
  72. .byte ashlsi3_10-ashlsi3_table
  73. .byte ashlsi3_11-ashlsi3_table
  74. .byte ashlsi3_12-ashlsi3_table
  75. .byte ashlsi3_13-ashlsi3_table
  76. .byte ashlsi3_14-ashlsi3_table
  77. .byte ashlsi3_15-ashlsi3_table
  78. .byte ashlsi3_16-ashlsi3_table
  79. .byte ashlsi3_17-ashlsi3_table
  80. .byte ashlsi3_18-ashlsi3_table
  81. .byte ashlsi3_19-ashlsi3_table
  82. .byte ashlsi3_20-ashlsi3_table
  83. .byte ashlsi3_21-ashlsi3_table
  84. .byte ashlsi3_22-ashlsi3_table
  85. .byte ashlsi3_23-ashlsi3_table
  86. .byte ashlsi3_24-ashlsi3_table
  87. .byte ashlsi3_25-ashlsi3_table
  88. .byte ashlsi3_26-ashlsi3_table
  89. .byte ashlsi3_27-ashlsi3_table
  90. .byte ashlsi3_28-ashlsi3_table
  91. .byte ashlsi3_29-ashlsi3_table
  92. .byte ashlsi3_30-ashlsi3_table
  93. .byte ashlsi3_31-ashlsi3_table
  94. ashlsi3_6:
  95. shll2 r0
  96. ashlsi3_4:
  97. shll2 r0
  98. ashlsi3_2:
  99. rts
  100. shll2 r0
  101. ashlsi3_7:
  102. shll2 r0
  103. ashlsi3_5:
  104. shll2 r0
  105. ashlsi3_3:
  106. shll2 r0
  107. ashlsi3_1:
  108. rts
  109. shll r0
  110. ashlsi3_14:
  111. shll2 r0
  112. ashlsi3_12:
  113. shll2 r0
  114. ashlsi3_10:
  115. shll2 r0
  116. ashlsi3_8:
  117. rts
  118. shll8 r0
  119. ashlsi3_15:
  120. shll2 r0
  121. ashlsi3_13:
  122. shll2 r0
  123. ashlsi3_11:
  124. shll2 r0
  125. ashlsi3_9:
  126. shll8 r0
  127. rts
  128. shll r0
  129. ashlsi3_22:
  130. shll2 r0
  131. ashlsi3_20:
  132. shll2 r0
  133. ashlsi3_18:
  134. shll2 r0
  135. ashlsi3_16:
  136. rts
  137. shll16 r0
  138. ashlsi3_23:
  139. shll2 r0
  140. ashlsi3_21:
  141. shll2 r0
  142. ashlsi3_19:
  143. shll2 r0
  144. ashlsi3_17:
  145. shll16 r0
  146. rts
  147. shll r0
  148. ashlsi3_30:
  149. shll2 r0
  150. ashlsi3_28:
  151. shll2 r0
  152. ashlsi3_26:
  153. shll2 r0
  154. ashlsi3_24:
  155. shll16 r0
  156. rts
  157. shll8 r0
  158. ashlsi3_31:
  159. shll2 r0
  160. ashlsi3_29:
  161. shll2 r0
  162. ashlsi3_27:
  163. shll2 r0
  164. ashlsi3_25:
  165. shll16 r0
  166. shll8 r0
  167. rts
  168. shll r0
  169. ashlsi3_0:
  170. rts
  171. nop