ashlsi3.S 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /* Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
  2. 2004, 2005, 2006
  3. Free Software Foundation, Inc.
  4. This file is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU General Public License as published by the
  6. Free Software Foundation; either version 2, or (at your option) any
  7. later version.
  8. In addition to the permissions in the GNU General Public License, the
  9. Free Software Foundation gives you unlimited permission to link the
  10. compiled version of this file into combinations with other programs,
  11. and to distribute those combinations without any restriction coming
  12. from the use of this file. (The General Public License restrictions
  13. do apply in other respects; for example, they cover modification of
  14. the file, and distribution when not linked into a combine
  15. executable.)
  16. This file is distributed in the hope that it will be useful, but
  17. WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. General Public License for more details.
  20. You should have received a copy of the GNU General Public License
  21. along with this program; see the file COPYING. If not, write to
  22. the Free Software Foundation, 51 Franklin Street, Fifth Floor,
  23. Boston, MA 02110-1301, USA. */
  24. !! libgcc routines for the Renesas / SuperH SH CPUs.
  25. !! Contributed by Steve Chamberlain.
  26. !! sac@cygnus.com
  27. !! ashiftrt_r4_x, ___ashrsi3, ___ashlsi3, ___lshrsi3 routines
  28. !! recoded in assembly by Toshiyasu Morita
  29. !! tm@netcom.com
  30. /* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
  31. ELF local label prefixes by J"orn Rennecke
  32. amylaar@cygnus.com */
  33. !
  34. ! __ashlsi3
  35. !
  36. ! Entry:
  37. !
  38. ! r4: Value to shift
  39. ! r5: Shifts
  40. !
  41. ! Exit:
  42. !
  43. ! r0: Result
  44. !
  45. ! Destroys:
  46. !
  47. ! (none)
  48. !
  49. .global __ashlsi3
  50. .align 2
  51. __ashlsi3:
  52. mov #31,r0
  53. and r0,r5
  54. mova ashlsi3_table,r0
  55. mov.b @(r0,r5),r5
  56. #ifdef __sh1__
  57. add r5,r0
  58. jmp @r0
  59. #else
  60. braf r5
  61. #endif
  62. mov r4,r0
  63. .align 2
  64. ashlsi3_table:
  65. .byte ashlsi3_0-ashlsi3_table
  66. .byte ashlsi3_1-ashlsi3_table
  67. .byte ashlsi3_2-ashlsi3_table
  68. .byte ashlsi3_3-ashlsi3_table
  69. .byte ashlsi3_4-ashlsi3_table
  70. .byte ashlsi3_5-ashlsi3_table
  71. .byte ashlsi3_6-ashlsi3_table
  72. .byte ashlsi3_7-ashlsi3_table
  73. .byte ashlsi3_8-ashlsi3_table
  74. .byte ashlsi3_9-ashlsi3_table
  75. .byte ashlsi3_10-ashlsi3_table
  76. .byte ashlsi3_11-ashlsi3_table
  77. .byte ashlsi3_12-ashlsi3_table
  78. .byte ashlsi3_13-ashlsi3_table
  79. .byte ashlsi3_14-ashlsi3_table
  80. .byte ashlsi3_15-ashlsi3_table
  81. .byte ashlsi3_16-ashlsi3_table
  82. .byte ashlsi3_17-ashlsi3_table
  83. .byte ashlsi3_18-ashlsi3_table
  84. .byte ashlsi3_19-ashlsi3_table
  85. .byte ashlsi3_20-ashlsi3_table
  86. .byte ashlsi3_21-ashlsi3_table
  87. .byte ashlsi3_22-ashlsi3_table
  88. .byte ashlsi3_23-ashlsi3_table
  89. .byte ashlsi3_24-ashlsi3_table
  90. .byte ashlsi3_25-ashlsi3_table
  91. .byte ashlsi3_26-ashlsi3_table
  92. .byte ashlsi3_27-ashlsi3_table
  93. .byte ashlsi3_28-ashlsi3_table
  94. .byte ashlsi3_29-ashlsi3_table
  95. .byte ashlsi3_30-ashlsi3_table
  96. .byte ashlsi3_31-ashlsi3_table
  97. ashlsi3_6:
  98. shll2 r0
  99. ashlsi3_4:
  100. shll2 r0
  101. ashlsi3_2:
  102. rts
  103. shll2 r0
  104. ashlsi3_7:
  105. shll2 r0
  106. ashlsi3_5:
  107. shll2 r0
  108. ashlsi3_3:
  109. shll2 r0
  110. ashlsi3_1:
  111. rts
  112. shll r0
  113. ashlsi3_14:
  114. shll2 r0
  115. ashlsi3_12:
  116. shll2 r0
  117. ashlsi3_10:
  118. shll2 r0
  119. ashlsi3_8:
  120. rts
  121. shll8 r0
  122. ashlsi3_15:
  123. shll2 r0
  124. ashlsi3_13:
  125. shll2 r0
  126. ashlsi3_11:
  127. shll2 r0
  128. ashlsi3_9:
  129. shll8 r0
  130. rts
  131. shll r0
  132. ashlsi3_22:
  133. shll2 r0
  134. ashlsi3_20:
  135. shll2 r0
  136. ashlsi3_18:
  137. shll2 r0
  138. ashlsi3_16:
  139. rts
  140. shll16 r0
  141. ashlsi3_23:
  142. shll2 r0
  143. ashlsi3_21:
  144. shll2 r0
  145. ashlsi3_19:
  146. shll2 r0
  147. ashlsi3_17:
  148. shll16 r0
  149. rts
  150. shll r0
  151. ashlsi3_30:
  152. shll2 r0
  153. ashlsi3_28:
  154. shll2 r0
  155. ashlsi3_26:
  156. shll2 r0
  157. ashlsi3_24:
  158. shll16 r0
  159. rts
  160. shll8 r0
  161. ashlsi3_31:
  162. shll2 r0
  163. ashlsi3_29:
  164. shll2 r0
  165. ashlsi3_27:
  166. shll2 r0
  167. ashlsi3_25:
  168. shll16 r0
  169. shll8 r0
  170. rts
  171. shll r0
  172. ashlsi3_0:
  173. rts
  174. nop