ashiftlt.S 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. ! GLOBAL(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