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