Linux 6.13-rc4
[linux.git] / arch / sh / lib / lshrsi3.S
blobb79b8170061f3350b2aca22570b1e6b25f0ef60f
1 /* SPDX-License-Identifier: GPL-2.0+ WITH GCC-exception-2.0
3    Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
4    2004, 2005, 2006
5    Free Software Foundation, Inc.
6 */
8 !! libgcc routines for the Renesas / SuperH SH CPUs.
9 !! Contributed by Steve Chamberlain.
10 !! sac@cygnus.com
12 !! ashiftrt_r4_x, ___ashrsi3, ___ashlsi3, ___lshrsi3 routines
13 !! recoded in assembly by Toshiyasu Morita
14 !! tm@netcom.com
16 /* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
17    ELF local label prefixes by J"orn Rennecke
18    amylaar@cygnus.com  */
21 ! __lshrsi3
23 ! Entry:
25 ! r4: Value to shift
26 ! r5: Shifts
28 ! Exit:
30 ! r0: Result
32 ! Destroys:
34 ! (none)
36 ! __lshrsi3_r0
38 ! Entry:
40 ! r0: Value to shift
41 ! r5: Shifts
43 ! Exit:
45 ! r0: Result
47 ! Destroys:
49 ! (none)
51         .global __lshrsi3
52         .global __lshrsi3_r0
53         
54         .align  2
55 __lshrsi3:
56         mov     r5,r0
57         .align  2
58 __lshrsi3_r0:
59         and     #31,r0
60         mov.l   r4,@-r15
61         mov     r0,r4
62         mova    lshrsi3_table,r0
63         mov.b   @(r0,r4),r4
64         add     r4,r0
65         jmp     @r0
66         mov.l   @r15+,r0
68         .align  2
69 lshrsi3_table:
70         .byte           lshrsi3_0-lshrsi3_table
71         .byte           lshrsi3_1-lshrsi3_table
72         .byte           lshrsi3_2-lshrsi3_table
73         .byte           lshrsi3_3-lshrsi3_table
74         .byte           lshrsi3_4-lshrsi3_table
75         .byte           lshrsi3_5-lshrsi3_table
76         .byte           lshrsi3_6-lshrsi3_table
77         .byte           lshrsi3_7-lshrsi3_table
78         .byte           lshrsi3_8-lshrsi3_table
79         .byte           lshrsi3_9-lshrsi3_table
80         .byte           lshrsi3_10-lshrsi3_table
81         .byte           lshrsi3_11-lshrsi3_table
82         .byte           lshrsi3_12-lshrsi3_table
83         .byte           lshrsi3_13-lshrsi3_table
84         .byte           lshrsi3_14-lshrsi3_table
85         .byte           lshrsi3_15-lshrsi3_table
86         .byte           lshrsi3_16-lshrsi3_table
87         .byte           lshrsi3_17-lshrsi3_table
88         .byte           lshrsi3_18-lshrsi3_table
89         .byte           lshrsi3_19-lshrsi3_table
90         .byte           lshrsi3_20-lshrsi3_table
91         .byte           lshrsi3_21-lshrsi3_table
92         .byte           lshrsi3_22-lshrsi3_table
93         .byte           lshrsi3_23-lshrsi3_table
94         .byte           lshrsi3_24-lshrsi3_table
95         .byte           lshrsi3_25-lshrsi3_table
96         .byte           lshrsi3_26-lshrsi3_table
97         .byte           lshrsi3_27-lshrsi3_table
98         .byte           lshrsi3_28-lshrsi3_table
99         .byte           lshrsi3_29-lshrsi3_table
100         .byte           lshrsi3_30-lshrsi3_table
101         .byte           lshrsi3_31-lshrsi3_table
103 lshrsi3_6:
104         shlr2   r0
105 lshrsi3_4:
106         shlr2   r0
107 lshrsi3_2:
108         rts
109         shlr2   r0
111 lshrsi3_7:
112         shlr2   r0
113 lshrsi3_5:
114         shlr2   r0
115 lshrsi3_3:
116         shlr2   r0
117 lshrsi3_1:
118         rts
119         shlr    r0
121 lshrsi3_14:
122         shlr2   r0
123 lshrsi3_12:
124         shlr2   r0
125 lshrsi3_10:
126         shlr2   r0
127 lshrsi3_8:
128         rts
129         shlr8   r0
131 lshrsi3_15:
132         shlr2   r0
133 lshrsi3_13:
134         shlr2   r0
135 lshrsi3_11:
136         shlr2   r0
137 lshrsi3_9:
138         shlr8   r0
139         rts
140         shlr    r0
142 lshrsi3_22:
143         shlr2   r0
144 lshrsi3_20:
145         shlr2   r0
146 lshrsi3_18:
147         shlr2   r0
148 lshrsi3_16:
149         rts
150         shlr16  r0
152 lshrsi3_23:
153         shlr2   r0
154 lshrsi3_21:
155         shlr2   r0
156 lshrsi3_19:
157         shlr2   r0
158 lshrsi3_17:
159         shlr16  r0
160         rts
161         shlr    r0
163 lshrsi3_30:
164         shlr2   r0
165 lshrsi3_28:
166         shlr2   r0
167 lshrsi3_26:
168         shlr2   r0
169 lshrsi3_24:
170         shlr16  r0
171         rts
172         shlr8   r0
174 lshrsi3_31:
175         shlr2   r0
176 lshrsi3_29:
177         shlr2   r0
178 lshrsi3_27:
179         shlr2   r0
180 lshrsi3_25:
181         shlr16  r0
182         shlr8   r0
183         rts
184         shlr    r0
186 lshrsi3_0:
187         rts
188         nop