^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) ! __ashrsi3
^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) ! __ashrsi3_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) .global __ashrsi3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) .global __ashrsi3_r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) .align 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) __ashrsi3:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) mov r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) .align 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) __ashrsi3_r0:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) and #31,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) mov.l r4,@-r15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) mov r0,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) mova ashrsi3_table,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) mov.b @(r0,r4),r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) add r4,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) jmp @r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) mov.l @r15+,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) .align 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) ashrsi3_table:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) .byte ashrsi3_0-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) .byte ashrsi3_1-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) .byte ashrsi3_2-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) .byte ashrsi3_3-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) .byte ashrsi3_4-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) .byte ashrsi3_5-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) .byte ashrsi3_6-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) .byte ashrsi3_7-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) .byte ashrsi3_8-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) .byte ashrsi3_9-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) .byte ashrsi3_10-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) .byte ashrsi3_11-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) .byte ashrsi3_12-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) .byte ashrsi3_13-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) .byte ashrsi3_14-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) .byte ashrsi3_15-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) .byte ashrsi3_16-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) .byte ashrsi3_17-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) .byte ashrsi3_18-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) .byte ashrsi3_19-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) .byte ashrsi3_20-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) .byte ashrsi3_21-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) .byte ashrsi3_22-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) .byte ashrsi3_23-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) .byte ashrsi3_24-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) .byte ashrsi3_25-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) .byte ashrsi3_26-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) .byte ashrsi3_27-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) .byte ashrsi3_28-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) .byte ashrsi3_29-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) .byte ashrsi3_30-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) .byte ashrsi3_31-ashrsi3_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) ashrsi3_31:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) rotcl r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) rts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) subc r0,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) ashrsi3_30:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) ashrsi3_29:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) ashrsi3_28:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) ashrsi3_27:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) ashrsi3_26:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) ashrsi3_25:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) ashrsi3_24:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) shlr16 r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) shlr8 r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) rts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) exts.b r0,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) ashrsi3_23:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) ashrsi3_22:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) ashrsi3_21:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) ashrsi3_20:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) ashrsi3_19:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) ashrsi3_18:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) ashrsi3_17:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) ashrsi3_16:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) shlr16 r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) rts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) exts.w r0,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) ashrsi3_15:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) ashrsi3_14:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) ashrsi3_13:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) ashrsi3_12:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) ashrsi3_11:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) ashrsi3_10:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) ashrsi3_9:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) ashrsi3_8:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) ashrsi3_7:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) ashrsi3_6:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) ashrsi3_5:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) ashrsi3_4:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) ashrsi3_3:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) ashrsi3_2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) ashrsi3_1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) rts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) shar r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) ashrsi3_0:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) rts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) nop