ashlsi3.S 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /* SPDX-License-Identifier: GPL-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. !! sac@cygnus.com
  9. !! ashiftrt_r4_x, ___ashrsi3, ___ashlsi3, ___lshrsi3 routines
  10. !! recoded in assembly by Toshiyasu Morita
  11. !! tm@netcom.com
  12. /* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
  13. ELF local label prefixes by J"orn Rennecke
  14. amylaar@cygnus.com */
  15. !
  16. ! GLOBAL(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. .global __ashlsi3
  32. .align 2
  33. __ashlsi3:
  34. mov #31,r0
  35. and r0,r5
  36. mova __ashlsi3_table,r0
  37. mov.b @(r0,r5),r5
  38. #ifdef __sh1__
  39. add r5,r0
  40. jmp @r0
  41. #else
  42. braf r5
  43. #endif
  44. mov r4,r0
  45. .align 2
  46. __ashlsi3_table:
  47. .byte __ashlsi3_0-__ashlsi3_table
  48. .byte __ashlsi3_1-__ashlsi3_table
  49. .byte __ashlsi3_2-__ashlsi3_table
  50. .byte __ashlsi3_3-__ashlsi3_table
  51. .byte __ashlsi3_4-__ashlsi3_table
  52. .byte __ashlsi3_5-__ashlsi3_table
  53. .byte __ashlsi3_6-__ashlsi3_table
  54. .byte __ashlsi3_7-__ashlsi3_table
  55. .byte __ashlsi3_8-__ashlsi3_table
  56. .byte __ashlsi3_9-__ashlsi3_table
  57. .byte __ashlsi3_10-__ashlsi3_table
  58. .byte __ashlsi3_11-__ashlsi3_table
  59. .byte __ashlsi3_12-__ashlsi3_table
  60. .byte __ashlsi3_13-__ashlsi3_table
  61. .byte __ashlsi3_14-__ashlsi3_table
  62. .byte __ashlsi3_15-__ashlsi3_table
  63. .byte __ashlsi3_16-__ashlsi3_table
  64. .byte __ashlsi3_17-__ashlsi3_table
  65. .byte __ashlsi3_18-__ashlsi3_table
  66. .byte __ashlsi3_19-__ashlsi3_table
  67. .byte __ashlsi3_20-__ashlsi3_table
  68. .byte __ashlsi3_21-__ashlsi3_table
  69. .byte __ashlsi3_22-__ashlsi3_table
  70. .byte __ashlsi3_23-__ashlsi3_table
  71. .byte __ashlsi3_24-__ashlsi3_table
  72. .byte __ashlsi3_25-__ashlsi3_table
  73. .byte __ashlsi3_26-__ashlsi3_table
  74. .byte __ashlsi3_27-__ashlsi3_table
  75. .byte __ashlsi3_28-__ashlsi3_table
  76. .byte __ashlsi3_29-__ashlsi3_table
  77. .byte __ashlsi3_30-__ashlsi3_table
  78. .byte __ashlsi3_31-__ashlsi3_table
  79. __ashlsi3_6:
  80. shll2 r0
  81. __ashlsi3_4:
  82. shll2 r0
  83. __ashlsi3_2:
  84. rts
  85. shll2 r0
  86. __ashlsi3_7:
  87. shll2 r0
  88. __ashlsi3_5:
  89. shll2 r0
  90. __ashlsi3_3:
  91. shll2 r0
  92. __ashlsi3_1:
  93. rts
  94. shll r0
  95. __ashlsi3_14:
  96. shll2 r0
  97. __ashlsi3_12:
  98. shll2 r0
  99. __ashlsi3_10:
  100. shll2 r0
  101. __ashlsi3_8:
  102. rts
  103. shll8 r0
  104. __ashlsi3_15:
  105. shll2 r0
  106. __ashlsi3_13:
  107. shll2 r0
  108. __ashlsi3_11:
  109. shll2 r0
  110. __ashlsi3_9:
  111. shll8 r0
  112. rts
  113. shll r0
  114. __ashlsi3_22:
  115. shll2 r0
  116. __ashlsi3_20:
  117. shll2 r0
  118. __ashlsi3_18:
  119. shll2 r0
  120. __ashlsi3_16:
  121. rts
  122. shll16 r0
  123. __ashlsi3_23:
  124. shll2 r0
  125. __ashlsi3_21:
  126. shll2 r0
  127. __ashlsi3_19:
  128. shll2 r0
  129. __ashlsi3_17:
  130. shll16 r0
  131. rts
  132. shll r0
  133. __ashlsi3_30:
  134. shll2 r0
  135. __ashlsi3_28:
  136. shll2 r0
  137. __ashlsi3_26:
  138. shll2 r0
  139. __ashlsi3_24:
  140. shll16 r0
  141. rts
  142. shll8 r0
  143. __ashlsi3_31:
  144. shll2 r0
  145. __ashlsi3_29:
  146. shll2 r0
  147. __ashlsi3_27:
  148. shll2 r0
  149. __ashlsi3_25:
  150. shll16 r0
  151. shll8 r0
  152. rts
  153. shll r0
  154. __ashlsi3_0:
  155. rts
  156. nop