Loading...
1/* Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2 2004, 2005, 2006
3 Free Software Foundation, Inc.
4
5This file is free software; you can redistribute it and/or modify it
6under the terms of the GNU General Public License as published by the
7Free Software Foundation; either version 2, or (at your option) any
8later version.
9
10In addition to the permissions in the GNU General Public License, the
11Free Software Foundation gives you unlimited permission to link the
12compiled version of this file into combinations with other programs,
13and to distribute those combinations without any restriction coming
14from the use of this file. (The General Public License restrictions
15do apply in other respects; for example, they cover modification of
16the file, and distribution when not linked into a combine
17executable.)
18
19This file is distributed in the hope that it will be useful, but
20WITHOUT ANY WARRANTY; without even the implied warranty of
21MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22General Public License for more details.
23
24You should have received a copy of the GNU General Public License
25along with this program; see the file COPYING. If not, write to
26the Free Software Foundation, 51 Franklin Street, Fifth Floor,
27Boston, MA 02110-1301, USA. */
28
29!! libgcc routines for the Renesas / SuperH SH CPUs.
30!! Contributed by Steve Chamberlain.
31!! sac@cygnus.com
32
33!! ashiftrt_r4_x, ___ashrsi3, ___ashlsi3, ___lshrsi3 routines
34!! recoded in assembly by Toshiyasu Morita
35!! tm@netcom.com
36
37/* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
38 ELF local label prefixes by J"orn Rennecke
39 amylaar@cygnus.com */
40
41!
42! __ashlsi3
43!
44! Entry:
45!
46! r4: Value to shift
47! r5: Shifts
48!
49! Exit:
50!
51! r0: Result
52!
53! Destroys:
54!
55! (none)
56!
57! __ashlsi3_r0
58!
59! Entry:
60!
61! r4: Value to shift
62! r0: Shifts
63!
64! Exit:
65!
66! r0: Result
67!
68! Destroys:
69!
70! (none)
71
72
73 .global __ashlsi3
74 .global __ashlsi3_r0
75
76 .align 2
77__ashlsi3:
78 mov r5,r0
79 .align 2
80__ashlsi3_r0:
81 and #31,r0
82 mov.l r4,@-r15
83 mov r0,r4
84 mova ashlsi3_table,r0
85 mov.b @(r0,r4),r4
86 add r4,r0
87 jmp @r0
88 mov.l @r15+,r0
89
90 .align 2
91ashlsi3_table:
92 .byte ashlsi3_0-ashlsi3_table
93 .byte ashlsi3_1-ashlsi3_table
94 .byte ashlsi3_2-ashlsi3_table
95 .byte ashlsi3_3-ashlsi3_table
96 .byte ashlsi3_4-ashlsi3_table
97 .byte ashlsi3_5-ashlsi3_table
98 .byte ashlsi3_6-ashlsi3_table
99 .byte ashlsi3_7-ashlsi3_table
100 .byte ashlsi3_8-ashlsi3_table
101 .byte ashlsi3_9-ashlsi3_table
102 .byte ashlsi3_10-ashlsi3_table
103 .byte ashlsi3_11-ashlsi3_table
104 .byte ashlsi3_12-ashlsi3_table
105 .byte ashlsi3_13-ashlsi3_table
106 .byte ashlsi3_14-ashlsi3_table
107 .byte ashlsi3_15-ashlsi3_table
108 .byte ashlsi3_16-ashlsi3_table
109 .byte ashlsi3_17-ashlsi3_table
110 .byte ashlsi3_18-ashlsi3_table
111 .byte ashlsi3_19-ashlsi3_table
112 .byte ashlsi3_20-ashlsi3_table
113 .byte ashlsi3_21-ashlsi3_table
114 .byte ashlsi3_22-ashlsi3_table
115 .byte ashlsi3_23-ashlsi3_table
116 .byte ashlsi3_24-ashlsi3_table
117 .byte ashlsi3_25-ashlsi3_table
118 .byte ashlsi3_26-ashlsi3_table
119 .byte ashlsi3_27-ashlsi3_table
120 .byte ashlsi3_28-ashlsi3_table
121 .byte ashlsi3_29-ashlsi3_table
122 .byte ashlsi3_30-ashlsi3_table
123 .byte ashlsi3_31-ashlsi3_table
124
125ashlsi3_6:
126 shll2 r0
127ashlsi3_4:
128 shll2 r0
129ashlsi3_2:
130 rts
131 shll2 r0
132
133ashlsi3_7:
134 shll2 r0
135ashlsi3_5:
136 shll2 r0
137ashlsi3_3:
138 shll2 r0
139ashlsi3_1:
140 rts
141 shll r0
142
143ashlsi3_14:
144 shll2 r0
145ashlsi3_12:
146 shll2 r0
147ashlsi3_10:
148 shll2 r0
149ashlsi3_8:
150 rts
151 shll8 r0
152
153ashlsi3_15:
154 shll2 r0
155ashlsi3_13:
156 shll2 r0
157ashlsi3_11:
158 shll2 r0
159ashlsi3_9:
160 shll8 r0
161 rts
162 shll r0
163
164ashlsi3_22:
165 shll2 r0
166ashlsi3_20:
167 shll2 r0
168ashlsi3_18:
169 shll2 r0
170ashlsi3_16:
171 rts
172 shll16 r0
173
174ashlsi3_23:
175 shll2 r0
176ashlsi3_21:
177 shll2 r0
178ashlsi3_19:
179 shll2 r0
180ashlsi3_17:
181 shll16 r0
182 rts
183 shll r0
184
185ashlsi3_30:
186 shll2 r0
187ashlsi3_28:
188 shll2 r0
189ashlsi3_26:
190 shll2 r0
191ashlsi3_24:
192 shll16 r0
193 rts
194 shll8 r0
195
196ashlsi3_31:
197 shll2 r0
198ashlsi3_29:
199 shll2 r0
200ashlsi3_27:
201 shll2 r0
202ashlsi3_25:
203 shll16 r0
204 shll8 r0
205 rts
206 shll r0
207
208ashlsi3_0:
209 rts
210 nop
1/* SPDX-License-Identifier: GPL-2.0+ WITH GCC-exception-2.0
2
3 Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
4 2004, 2005, 2006
5 Free Software Foundation, Inc.
6*/
7
8!! libgcc routines for the Renesas / SuperH SH CPUs.
9!! Contributed by Steve Chamberlain.
10!! sac@cygnus.com
11
12!! ashiftrt_r4_x, ___ashrsi3, ___ashlsi3, ___lshrsi3 routines
13!! recoded in assembly by Toshiyasu Morita
14!! tm@netcom.com
15
16/* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
17 ELF local label prefixes by J"orn Rennecke
18 amylaar@cygnus.com */
19
20!
21! __ashlsi3
22!
23! Entry:
24!
25! r4: Value to shift
26! r5: Shifts
27!
28! Exit:
29!
30! r0: Result
31!
32! Destroys:
33!
34! (none)
35!
36! __ashlsi3_r0
37!
38! Entry:
39!
40! r4: Value to shift
41! r0: Shifts
42!
43! Exit:
44!
45! r0: Result
46!
47! Destroys:
48!
49! (none)
50
51
52 .global __ashlsi3
53 .global __ashlsi3_r0
54
55 .align 2
56__ashlsi3:
57 mov r5,r0
58 .align 2
59__ashlsi3_r0:
60 and #31,r0
61 mov.l r4,@-r15
62 mov r0,r4
63 mova ashlsi3_table,r0
64 mov.b @(r0,r4),r4
65 add r4,r0
66 jmp @r0
67 mov.l @r15+,r0
68
69 .align 2
70ashlsi3_table:
71 .byte ashlsi3_0-ashlsi3_table
72 .byte ashlsi3_1-ashlsi3_table
73 .byte ashlsi3_2-ashlsi3_table
74 .byte ashlsi3_3-ashlsi3_table
75 .byte ashlsi3_4-ashlsi3_table
76 .byte ashlsi3_5-ashlsi3_table
77 .byte ashlsi3_6-ashlsi3_table
78 .byte ashlsi3_7-ashlsi3_table
79 .byte ashlsi3_8-ashlsi3_table
80 .byte ashlsi3_9-ashlsi3_table
81 .byte ashlsi3_10-ashlsi3_table
82 .byte ashlsi3_11-ashlsi3_table
83 .byte ashlsi3_12-ashlsi3_table
84 .byte ashlsi3_13-ashlsi3_table
85 .byte ashlsi3_14-ashlsi3_table
86 .byte ashlsi3_15-ashlsi3_table
87 .byte ashlsi3_16-ashlsi3_table
88 .byte ashlsi3_17-ashlsi3_table
89 .byte ashlsi3_18-ashlsi3_table
90 .byte ashlsi3_19-ashlsi3_table
91 .byte ashlsi3_20-ashlsi3_table
92 .byte ashlsi3_21-ashlsi3_table
93 .byte ashlsi3_22-ashlsi3_table
94 .byte ashlsi3_23-ashlsi3_table
95 .byte ashlsi3_24-ashlsi3_table
96 .byte ashlsi3_25-ashlsi3_table
97 .byte ashlsi3_26-ashlsi3_table
98 .byte ashlsi3_27-ashlsi3_table
99 .byte ashlsi3_28-ashlsi3_table
100 .byte ashlsi3_29-ashlsi3_table
101 .byte ashlsi3_30-ashlsi3_table
102 .byte ashlsi3_31-ashlsi3_table
103
104ashlsi3_6:
105 shll2 r0
106ashlsi3_4:
107 shll2 r0
108ashlsi3_2:
109 rts
110 shll2 r0
111
112ashlsi3_7:
113 shll2 r0
114ashlsi3_5:
115 shll2 r0
116ashlsi3_3:
117 shll2 r0
118ashlsi3_1:
119 rts
120 shll r0
121
122ashlsi3_14:
123 shll2 r0
124ashlsi3_12:
125 shll2 r0
126ashlsi3_10:
127 shll2 r0
128ashlsi3_8:
129 rts
130 shll8 r0
131
132ashlsi3_15:
133 shll2 r0
134ashlsi3_13:
135 shll2 r0
136ashlsi3_11:
137 shll2 r0
138ashlsi3_9:
139 shll8 r0
140 rts
141 shll r0
142
143ashlsi3_22:
144 shll2 r0
145ashlsi3_20:
146 shll2 r0
147ashlsi3_18:
148 shll2 r0
149ashlsi3_16:
150 rts
151 shll16 r0
152
153ashlsi3_23:
154 shll2 r0
155ashlsi3_21:
156 shll2 r0
157ashlsi3_19:
158 shll2 r0
159ashlsi3_17:
160 shll16 r0
161 rts
162 shll r0
163
164ashlsi3_30:
165 shll2 r0
166ashlsi3_28:
167 shll2 r0
168ashlsi3_26:
169 shll2 r0
170ashlsi3_24:
171 shll16 r0
172 rts
173 shll8 r0
174
175ashlsi3_31:
176 shll2 r0
177ashlsi3_29:
178 shll2 r0
179ashlsi3_27:
180 shll2 r0
181ashlsi3_25:
182 shll16 r0
183 shll8 r0
184 rts
185 shll r0
186
187ashlsi3_0:
188 rts
189 nop