1 /* Copyright (C) 1994 Free Software Foundation, Inc.
3 This file is free software; you can redistribute it and/or modify it
4 under the terms of the GNU General Public License as published by the
5 Free Software Foundation; either version 2, or (at your option) any
8 In addition to the permissions in the GNU General Public License, the
9 Free Software Foundation gives you unlimited permission to link the
10 compiled version of this file with other programs, and to distribute
11 those programs without any restriction coming from the use of this
12 file. (The General Public License restrictions do apply in other
13 respects; for example, they cover modification of the file, and
14 distribution when not linked into another program.)
16 This file is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; see the file COPYING. If not, write to
23 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
25 /* As a special exception, if you link this library with other files,
26 some of which are compiled with GCC, to produce an executable,
27 this library does not by itself cause the resulting executable
28 to be covered by the GNU General Public License.
29 This exception does not however invalidate any other reasons why
30 the executable file might be covered by the GNU General Public License. */
33 !! libgcc1 routines for the Hitachi SH cpu.
34 !! Contributed by Steve Chamberlain.
37 !! ashiftrt_r4_x, ___ashrsi3, ___ashlsi3, ___lshrsi3 routines
38 !! recoded in assembly by Toshiyasu Morita
42 .global ___ashiftrt_r4_0
43 .global ___ashiftrt_r4_1
44 .global ___ashiftrt_r4_2
45 .global ___ashiftrt_r4_3
46 .global ___ashiftrt_r4_4
47 .global ___ashiftrt_r4_5
48 .global ___ashiftrt_r4_6
49 .global ___ashiftrt_r4_7
50 .global ___ashiftrt_r4_8
51 .global ___ashiftrt_r4_9
52 .global ___ashiftrt_r4_10
53 .global ___ashiftrt_r4_11
54 .global ___ashiftrt_r4_12
55 .global ___ashiftrt_r4_13
56 .global ___ashiftrt_r4_14
57 .global ___ashiftrt_r4_15
58 .global ___ashiftrt_r4_16
59 .global ___ashiftrt_r4_17
60 .global ___ashiftrt_r4_18
61 .global ___ashiftrt_r4_19
62 .global ___ashiftrt_r4_20
63 .global ___ashiftrt_r4_21
64 .global ___ashiftrt_r4_22
65 .global ___ashiftrt_r4_23
66 .global ___ashiftrt_r4_24
67 .global ___ashiftrt_r4_25
68 .global ___ashiftrt_r4_26
69 .global ___ashiftrt_r4_27
70 .global ___ashiftrt_r4_28
71 .global ___ashiftrt_r4_29
72 .global ___ashiftrt_r4_30
73 .global ___ashiftrt_r4_31
74 .global ___ashiftrt_r4_32
182 mova L_ashrsi3_table,r0
184 add r5,r0 ! Change to braf when gas is fixed
189 .byte L_ashrsi3_0-L_ashrsi3_table
190 .byte L_ashrsi3_1-L_ashrsi3_table
191 .byte L_ashrsi3_2-L_ashrsi3_table
192 .byte L_ashrsi3_3-L_ashrsi3_table
193 .byte L_ashrsi3_4-L_ashrsi3_table
194 .byte L_ashrsi3_5-L_ashrsi3_table
195 .byte L_ashrsi3_6-L_ashrsi3_table
196 .byte L_ashrsi3_7-L_ashrsi3_table
197 .byte L_ashrsi3_8-L_ashrsi3_table
198 .byte L_ashrsi3_9-L_ashrsi3_table
199 .byte L_ashrsi3_10-L_ashrsi3_table
200 .byte L_ashrsi3_11-L_ashrsi3_table
201 .byte L_ashrsi3_12-L_ashrsi3_table
202 .byte L_ashrsi3_13-L_ashrsi3_table
203 .byte L_ashrsi3_14-L_ashrsi3_table
204 .byte L_ashrsi3_15-L_ashrsi3_table
205 .byte L_ashrsi3_16-L_ashrsi3_table
206 .byte L_ashrsi3_17-L_ashrsi3_table
207 .byte L_ashrsi3_18-L_ashrsi3_table
208 .byte L_ashrsi3_19-L_ashrsi3_table
209 .byte L_ashrsi3_20-L_ashrsi3_table
210 .byte L_ashrsi3_21-L_ashrsi3_table
211 .byte L_ashrsi3_22-L_ashrsi3_table
212 .byte L_ashrsi3_23-L_ashrsi3_table
213 .byte L_ashrsi3_24-L_ashrsi3_table
214 .byte L_ashrsi3_25-L_ashrsi3_table
215 .byte L_ashrsi3_26-L_ashrsi3_table
216 .byte L_ashrsi3_27-L_ashrsi3_table
217 .byte L_ashrsi3_28-L_ashrsi3_table
218 .byte L_ashrsi3_29-L_ashrsi3_table
219 .byte L_ashrsi3_30-L_ashrsi3_table
220 .byte L_ashrsi3_31-L_ashrsi3_table
326 mova L_ashlsi3_table,r0
328 add r5,r0 ! Change to braf when gas is fixed
333 .byte L_ashlsi3_0-L_ashlsi3_table
334 .byte L_ashlsi3_1-L_ashlsi3_table
335 .byte L_ashlsi3_2-L_ashlsi3_table
336 .byte L_ashlsi3_3-L_ashlsi3_table
337 .byte L_ashlsi3_4-L_ashlsi3_table
338 .byte L_ashlsi3_5-L_ashlsi3_table
339 .byte L_ashlsi3_6-L_ashlsi3_table
340 .byte L_ashlsi3_7-L_ashlsi3_table
341 .byte L_ashlsi3_8-L_ashlsi3_table
342 .byte L_ashlsi3_9-L_ashlsi3_table
343 .byte L_ashlsi3_10-L_ashlsi3_table
344 .byte L_ashlsi3_11-L_ashlsi3_table
345 .byte L_ashlsi3_12-L_ashlsi3_table
346 .byte L_ashlsi3_13-L_ashlsi3_table
347 .byte L_ashlsi3_14-L_ashlsi3_table
348 .byte L_ashlsi3_15-L_ashlsi3_table
349 .byte L_ashlsi3_16-L_ashlsi3_table
350 .byte L_ashlsi3_17-L_ashlsi3_table
351 .byte L_ashlsi3_18-L_ashlsi3_table
352 .byte L_ashlsi3_19-L_ashlsi3_table
353 .byte L_ashlsi3_20-L_ashlsi3_table
354 .byte L_ashlsi3_21-L_ashlsi3_table
355 .byte L_ashlsi3_22-L_ashlsi3_table
356 .byte L_ashlsi3_23-L_ashlsi3_table
357 .byte L_ashlsi3_24-L_ashlsi3_table
358 .byte L_ashlsi3_25-L_ashlsi3_table
359 .byte L_ashlsi3_26-L_ashlsi3_table
360 .byte L_ashlsi3_27-L_ashlsi3_table
361 .byte L_ashlsi3_28-L_ashlsi3_table
362 .byte L_ashlsi3_29-L_ashlsi3_table
363 .byte L_ashlsi3_30-L_ashlsi3_table
364 .byte L_ashlsi3_31-L_ashlsi3_table
483 mova L_lshrsi3_table,r0
485 add r5,r0 ! Change to braf when gas is fixed
490 .byte L_lshrsi3_0-L_lshrsi3_table
491 .byte L_lshrsi3_1-L_lshrsi3_table
492 .byte L_lshrsi3_2-L_lshrsi3_table
493 .byte L_lshrsi3_3-L_lshrsi3_table
494 .byte L_lshrsi3_4-L_lshrsi3_table
495 .byte L_lshrsi3_5-L_lshrsi3_table
496 .byte L_lshrsi3_6-L_lshrsi3_table
497 .byte L_lshrsi3_7-L_lshrsi3_table
498 .byte L_lshrsi3_8-L_lshrsi3_table
499 .byte L_lshrsi3_9-L_lshrsi3_table
500 .byte L_lshrsi3_10-L_lshrsi3_table
501 .byte L_lshrsi3_11-L_lshrsi3_table
502 .byte L_lshrsi3_12-L_lshrsi3_table
503 .byte L_lshrsi3_13-L_lshrsi3_table
504 .byte L_lshrsi3_14-L_lshrsi3_table
505 .byte L_lshrsi3_15-L_lshrsi3_table
506 .byte L_lshrsi3_16-L_lshrsi3_table
507 .byte L_lshrsi3_17-L_lshrsi3_table
508 .byte L_lshrsi3_18-L_lshrsi3_table
509 .byte L_lshrsi3_19-L_lshrsi3_table
510 .byte L_lshrsi3_20-L_lshrsi3_table
511 .byte L_lshrsi3_21-L_lshrsi3_table
512 .byte L_lshrsi3_22-L_lshrsi3_table
513 .byte L_lshrsi3_23-L_lshrsi3_table
514 .byte L_lshrsi3_24-L_lshrsi3_table
515 .byte L_lshrsi3_25-L_lshrsi3_table
516 .byte L_lshrsi3_26-L_lshrsi3_table
517 .byte L_lshrsi3_27-L_lshrsi3_table
518 .byte L_lshrsi3_28-L_lshrsi3_table
519 .byte L_lshrsi3_29-L_lshrsi3_table
520 .byte L_lshrsi3_30-L_lshrsi3_table
521 .byte L_lshrsi3_31-L_lshrsi3_table
618 ! done all the large groups, do the remainder
629 .global ___movstrSI64
633 .global ___movstrSI60
637 .global ___movstrSI56
641 .global ___movstrSI52
645 .global ___movstrSI48
649 .global ___movstrSI44
653 .global ___movstrSI40
657 .global ___movstrSI36
661 .global ___movstrSI32
665 .global ___movstrSI28
669 .global ___movstrSI24
673 .global ___movstrSI20
677 .global ___movstrSI16
681 .global ___movstrSI12
765 ! r0 = aabb*ccdd via partial products
767 ! if aa == 0 and cc = 0
771 ! aa = bb*dd + (aa*dd*65536) + (cc*bb*65536)
775 mulu r4,r5 ! multiply the lsws macl=bb*dd
776 mov r5,r3 ! r3 = ccdd
777 swap.w r4,r2 ! r2 = bbaa
778 xtrct r2,r3 ! r3 = aacc
779 tst r3,r3 ! msws zero ?
781 rts ! yes - then weve got the answer
784 hiset: sts macl,r0 ! r0 = bb*dd
785 mulu r2,r5 | brewing macl = aa*dd
787 mulu r3,r4 | brewing macl = cc*bb
798 !! 4 byte integer Divide code for the Hitachi SH
805 !! args in r4 and r5, result in r0 clobber r1,r2,r3
896 !! 4 byte integer Divide code for the Hitachi SH
903 !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit
910 ! get one bit from the msb of the numerator into the T
911 ! bit and divide it by whats in r5. Put the answer bit
912 ! into the T bit so it can come out again at the bottom
914 rotcl r4 ; div1 r5,r0
915 rotcl r4 ; div1 r5,r0
916 rotcl r4 ; div1 r5,r0
917 rotcl r4 ; div1 r5,r0
918 rotcl r4 ; div1 r5,r0
919 rotcl r4 ; div1 r5,r0
920 rotcl r4 ; div1 r5,r0
921 rotcl r4 ; div1 r5,r0
923 rotcl r4 ; div1 r5,r0
924 rotcl r4 ; div1 r5,r0
925 rotcl r4 ; div1 r5,r0
926 rotcl r4 ; div1 r5,r0
927 rotcl r4 ; div1 r5,r0
928 rotcl r4 ; div1 r5,r0
929 rotcl r4 ; div1 r5,r0
930 rotcl r4 ; div1 r5,r0
932 rotcl r4 ; div1 r5,r0
933 rotcl r4 ; div1 r5,r0
934 rotcl r4 ; div1 r5,r0
935 rotcl r4 ; div1 r5,r0
936 rotcl r4 ; div1 r5,r0
937 rotcl r4 ; div1 r5,r0
938 rotcl r4 ; div1 r5,r0
939 rotcl r4 ; div1 r5,r0
942 rotcl r4 ; div1 r5,r0
943 rotcl r4 ; div1 r5,r0
944 rotcl r4 ; div1 r5,r0
945 rotcl r4 ; div1 r5,r0
946 rotcl r4 ; div1 r5,r0
947 rotcl r4 ; div1 r5,r0
948 rotcl r4 ; div1 r5,r0
949 rotcl r4 ; div1 r5,r0