1 /* libgcc routines for NEC V850.
2 Copyright
(C
) 1996, 1997, 2002, 2005 Free Software Foundation
, Inc.
4 This file is part of GCC.
6 GCC is free software
; you can redistribute it and/or modify it
7 under the terms of the GNU General
Public License as published by the
8 Free Software Foundation
; either version 2, or (at your option) any
11 In addition to the permissions
in the GNU General
Public License
, the
12 Free Software Foundation gives you unlimited permission to link the
13 compiled version of
this file
into combinations with other programs
,
14 and to distribute those combinations without any restriction coming
15 from the use of
this file.
(The General
Public License restrictions
16 do apply
in other respects
; for example, they cover modification of
17 the file
, and distribution when
not linked
into a combine
20 This file is distributed
in the hope that it will be useful
, but
21 WITHOUT ANY WARRANTY
; without even the implied warranty of
22 MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General
Public License for more details.
25 You should have received a copy of the GNU General
Public License
26 along with
this program
; see the file COPYING. If not, write to
27 the Free Software Foundation
, 51 Franklin Street
, Fifth Floor
,
28 Boston
, MA
02110-1301, USA.
*/
33 .
type ___mulsi3
,@function
38 #define
MASK ((1 << SHIFT
) - 1)
42 short a_part = (a >> (i)) & MASK; \
43 short b_part = (b >> (j)) & MASK; \
44 int res = (((int) a_part) * ((int) b_part)); \
49 __mulsi3
(unsigned a
, unsigned b
)
52 ((STEP (SHIFT, 0) + STEP (0, SHIFT)) << SHIFT) +
53 ((STEP (0, 2 * SHIFT) + STEP (SHIFT, SHIFT) + STEP (2 * SHIFT, 0))
58 movea lo
(32767), r0
, r10
88 #if defined
(__v850e__
) || defined
(__v850ea__
)
89 /* This routine is almost unneccesarry because gcc
90 generates the
MUL instruction for the RTX mulsi3.
91 But if someone wants to link his application with
92 previsously compiled v850 objects then they will
93 need
this function.
*/
95 /* It isn
't good to put the inst sequence as below;
98 In this case, there is a RAW hazard between them.
99 MUL inst takes 2 cycle in EX stage, then MOV inst
104 #endif /* __v850e__ */
105 .size ___mulsi3,.-___mulsi3
106 #endif /* L_mulsi3 */
112 .type ___udivsi3,@function
119 movhi hi(-2147483648),r0,r13
147 #else /* defined(__v850e__) */
149 /* See comments at end of __mulsi3. */
154 #endif /* __v850e__ */
156 .size ___udivsi3,.-___udivsi3
162 .type ___divsi3,@function
189 #else /* defined(__v850e__) */
191 /* See comments at end of __mulsi3. */
196 #endif /* __v850e__ */
198 .size ___divsi3,.-___divsi3
204 .type ___umodsi3,@function
221 #else /* defined(__v850e__) */
223 /* See comments at end of __mulsi3. */
227 #endif /* __v850e__ */
229 .size ___umodsi3,.-___umodsi3
230 #endif /* L_umodsi3 */
235 .type ___modsi3,@function
252 #else /* defined(__v850e__) */
254 /* See comments at end of __mulsi3. */
258 #endif /* __v850e__ */
260 .size ___modsi3,.-___modsi3
261 #endif /* L_modsi3 */
267 .type __save_r2_r29,@function
268 /* Allocate space and save registers 2, 20 .. 29 on the stack */
269 /* Called via: jalr __save_r2_r29,r10 */
302 .size __save_r2_r29,.-__save_r2_r29
304 /* Restore saved registers, deallocate stack and return to the user */
305 /* Called via: jr __return_r2_r29 */
307 .globl __return_r2_r29
308 .type __return_r2_r29,@function
341 .size __return_r2_r29,.-__return_r2_r29
342 #endif /* L_save_2 */
347 .globl __save_r20_r29
348 .type __save_r20_r29,@function
349 /* Allocate space and save registers 20 .. 29 on the stack */
350 /* Called via: jalr __save_r20_r29,r10 */
381 .size __save_r20_r29,.-__save_r20_r29
383 /* Restore saved registers, deallocate stack and return to the user */
384 /* Called via: jr __return_r20_r29 */
386 .globl __return_r20_r29
387 .type __return_r20_r29,@function
418 .size __return_r20_r29,.-__return_r20_r29
419 #endif /* L_save_20 */
424 .globl __save_r21_r29
425 .type __save_r21_r29,@function
426 /* Allocate space and save registers 21 .. 29 on the stack */
427 /* Called via: jalr __save_r21_r29,r10 */
456 .size __save_r21_r29,.-__save_r21_r29
458 /* Restore saved registers, deallocate stack and return to the user */
459 /* Called via: jr __return_r21_r29 */
461 .globl __return_r21_r29
462 .type __return_r21_r29,@function
491 .size __return_r21_r29,.-__return_r21_r29
492 #endif /* L_save_21 */
497 .globl __save_r22_r29
498 .type __save_r22_r29,@function
499 /* Allocate space and save registers 22 .. 29 on the stack */
500 /* Called via: jalr __save_r22_r29,r10 */
527 .size __save_r22_r29,.-__save_r22_r29
529 /* Restore saved registers, deallocate stack and return to the user */
530 /* Called via: jr __return_r22_r29 */
532 .globl __return_r22_r29
533 .type __return_r22_r29,@function
560 .size __return_r22_r29,.-__return_r22_r29
561 #endif /* L_save_22 */
566 .globl __save_r23_r29
567 .type __save_r23_r29,@function
568 /* Allocate space and save registers 23 .. 29 on the stack */
569 /* Called via: jalr __save_r23_r29,r10 */
594 .size __save_r23_r29,.-__save_r23_r29
596 /* Restore saved registers, deallocate stack and return to the user */
597 /* Called via: jr __return_r23_r29 */
599 .globl __return_r23_r29
600 .type __return_r23_r29,@function
625 .size __return_r23_r29,.-__return_r23_r29
626 #endif /* L_save_23 */
631 .globl __save_r24_r29
632 .type __save_r24_r29,@function
633 /* Allocate space and save registers 24 .. 29 on the stack */
634 /* Called via: jalr __save_r24_r29,r10 */
657 .size __save_r24_r29,.-__save_r24_r29
659 /* Restore saved registers, deallocate stack and return to the user */
660 /* Called via: jr __return_r24_r29 */
662 .globl __return_r24_r29
663 .type __return_r24_r29,@function
686 .size __return_r24_r29,.-__return_r24_r29
687 #endif /* L_save_24 */
692 .globl __save_r25_r29
693 .type __save_r25_r29,@function
694 /* Allocate space and save registers 25 .. 29 on the stack */
695 /* Called via: jalr __save_r25_r29,r10 */
716 .size __save_r25_r29,.-__save_r25_r29
718 /* Restore saved registers, deallocate stack and return to the user */
719 /* Called via: jr __return_r25_r29 */
721 .globl __return_r25_r29
722 .type __return_r25_r29,@function
743 .size __return_r25_r29,.-__return_r25_r29
744 #endif /* L_save_25 */
749 .globl __save_r26_r29
750 .type __save_r26_r29,@function
751 /* Allocate space and save registers 26 .. 29 on the stack */
752 /* Called via: jalr __save_r26_r29,r10 */
771 .size __save_r26_r29,.-__save_r26_r29
773 /* Restore saved registers, deallocate stack and return to the user */
774 /* Called via: jr __return_r26_r29 */
776 .globl __return_r26_r29
777 .type __return_r26_r29,@function
796 .size __return_r26_r29,.-__return_r26_r29
797 #endif /* L_save_26 */
802 .globl __save_r27_r29
803 .type __save_r27_r29,@function
804 /* Allocate space and save registers 27 .. 29 on the stack */
805 /* Called via: jalr __save_r27_r29,r10 */
812 .size __save_r27_r29,.-__save_r27_r29
814 /* Restore saved registers, deallocate stack and return to the user */
815 /* Called via: jr __return_r27_r29 */
817 .globl __return_r27_r29
818 .type __return_r27_r29,@function
825 .size __return_r27_r29,.-__return_r27_r29
826 #endif /* L_save_27 */
831 .globl __save_r28_r29
832 .type __save_r28_r29,@function
833 /* Allocate space and save registers 28,29 on the stack */
834 /* Called via: jalr __save_r28_r29,r10 */
840 .size __save_r28_r29,.-__save_r28_r29
842 /* Restore saved registers, deallocate stack and return to the user */
843 /* Called via: jr __return_r28_r29 */
845 .globl __return_r28_r29
846 .type __return_r28_r29,@function
852 .size __return_r28_r29,.-__return_r28_r29
853 #endif /* L_save_28 */
859 .type __save_r29,@function
860 /* Allocate space and save register 29 on the stack */
861 /* Called via: jalr __save_r29,r10 */
866 .size __save_r29,.-__save_r29
868 /* Restore saved register 29, deallocate stack and return to the user */
869 /* Called via: jr __return_r29 */
872 .type __return_r29,@function
877 .size __return_r29,.-__return_r29
878 #endif /* L_save_28 */
884 .type __save_r2_r31,@function
885 /* Allocate space and save registers 20 .. 29, 31 on the stack. */
886 /* Also allocate space for the argument save area. */
887 /* Called via: jalr __save_r2_r31,r10. */
922 .size __save_r2_r31,.-__save_r2_r31
924 /* Restore saved registers, deallocate stack and return to the user */
925 /* Called via: jr __return_r20_r31 */
927 .globl __return_r2_r31
928 .type __return_r2_r31,@function
963 .size __return_r2_r31,.-__return_r2_r31
964 #endif /* L_save_2c */
969 .globl __save_r20_r31
970 .type __save_r20_r31,@function
971 /* Allocate space and save registers 20 .. 29, 31 on the stack */
972 /* Also allocate space for the argument save area */
973 /* Called via: jalr __save_r20_r31,r10 */
1006 .size __save_r20_r31,.-__save_r20_r31
1008 /* Restore saved registers, deallocate stack and return to the user */
1009 /* Called via: jr __return_r20_r31 */
1011 .globl __return_r20_r31
1012 .type __return_r20_r31,@function
1045 .size __return_r20_r31,.-__return_r20_r31
1046 #endif /* L_save_20c */
1051 .globl __save_r21_r31
1052 .type __save_r21_r31,@function
1053 /* Allocate space and save registers 21 .. 29, 31 on the stack */
1054 /* Also allocate space for the argument save area */
1055 /* Called via: jalr __save_r21_r31,r10 */
1086 .size __save_r21_r31,.-__save_r21_r31
1088 /* Restore saved registers, deallocate stack and return to the user */
1089 /* Called via: jr __return_r21_r31 */
1091 .globl __return_r21_r31
1092 .type __return_r21_r31,@function
1123 .size __return_r21_r31,.-__return_r21_r31
1124 #endif /* L_save_21c */
1129 .globl __save_r22_r31
1130 .type __save_r22_r31,@function
1131 /* Allocate space and save registers 22 .. 29, 31 on the stack */
1132 /* Also allocate space for the argument save area */
1133 /* Called via: jalr __save_r22_r31,r10 */
1162 .size __save_r22_r31,.-__save_r22_r31
1164 /* Restore saved registers, deallocate stack and return to the user */
1165 /* Called via: jr __return_r22_r31 */
1167 .globl __return_r22_r31
1168 .type __return_r22_r31,@function
1197 .size __return_r22_r31,.-__return_r22_r31
1198 #endif /* L_save_22c */
1203 .globl __save_r23_r31
1204 .type __save_r23_r31,@function
1205 /* Allocate space and save registers 23 .. 29, 31 on the stack */
1206 /* Also allocate space for the argument save area */
1207 /* Called via: jalr __save_r23_r31,r10 */
1234 .size __save_r23_r31,.-__save_r23_r31
1236 /* Restore saved registers, deallocate stack and return to the user */
1237 /* Called via: jr __return_r23_r31 */
1239 .globl __return_r23_r31
1240 .type __return_r23_r31,@function
1267 .size __return_r23_r31,.-__return_r23_r31
1268 #endif /* L_save_23c */
1273 .globl __save_r24_r31
1274 .type __save_r24_r31,@function
1275 /* Allocate space and save registers 24 .. 29, 31 on the stack */
1276 /* Also allocate space for the argument save area */
1277 /* Called via: jalr __save_r24_r31,r10 */
1302 .size __save_r24_r31,.-__save_r24_r31
1304 /* Restore saved registers, deallocate stack and return to the user */
1305 /* Called via: jr __return_r24_r31 */
1307 .globl __return_r24_r31
1308 .type __return_r24_r31,@function
1333 .size __return_r24_r31,.-__return_r24_r31
1334 #endif /* L_save_24c */
1339 .globl __save_r25_r31
1340 .type __save_r25_r31,@function
1341 /* Allocate space and save registers 25 .. 29, 31 on the stack */
1342 /* Also allocate space for the argument save area */
1343 /* Called via: jalr __save_r25_r31,r10 */
1366 .size __save_r25_r31,.-__save_r25_r31
1368 /* Restore saved registers, deallocate stack and return to the user */
1369 /* Called via: jr __return_r25_r31 */
1371 .globl __return_r25_r31
1372 .type __return_r25_r31,@function
1395 .size __return_r25_r31,.-__return_r25_r31
1396 #endif /* L_save_25c */
1401 .globl __save_r26_r31
1402 .type __save_r26_r31,@function
1403 /* Allocate space and save registers 26 .. 29, 31 on the stack */
1404 /* Also allocate space for the argument save area */
1405 /* Called via: jalr __save_r26_r31,r10 */
1426 .size __save_r26_r31,.-__save_r26_r31
1428 /* Restore saved registers, deallocate stack and return to the user */
1429 /* Called via: jr __return_r26_r31 */
1431 .globl __return_r26_r31
1432 .type __return_r26_r31,@function
1453 .size __return_r26_r31,.-__return_r26_r31
1454 #endif /* L_save_26c */
1459 .globl __save_r27_r31
1460 .type __save_r27_r31,@function
1461 /* Allocate space and save registers 27 .. 29, 31 on the stack */
1462 /* Also allocate space for the argument save area */
1463 /* Called via: jalr __save_r27_r31,r10 */
1482 .size __save_r27_r31,.-__save_r27_r31
1484 /* Restore saved registers, deallocate stack and return to the user */
1485 /* Called via: jr __return_r27_r31 */
1487 .globl __return_r27_r31
1488 .type __return_r27_r31,@function
1507 .size __return_r27_r31,.-__return_r27_r31
1508 #endif /* L_save_27c */
1513 .globl __save_r28_r31
1514 .type __save_r28_r31,@function
1515 /* Allocate space and save registers 28 .. 29, 31 on the stack */
1516 /* Also allocate space for the argument save area */
1517 /* Called via: jalr __save_r28_r31,r10 */
1524 .size __save_r28_r31,.-__save_r28_r31
1526 /* Restore saved registers, deallocate stack and return to the user */
1527 /* Called via: jr __return_r28_r31 */
1529 .globl __return_r28_r31
1530 .type __return_r28_r31,@function
1537 .size __return_r28_r31,.-__return_r28_r31
1538 #endif /* L_save_28c */
1543 .globl __save_r29_r31
1544 .type __save_r29_r31,@function
1545 /* Allocate space and save registers 29 & 31 on the stack */
1546 /* Also allocate space for the argument save area */
1547 /* Called via: jalr __save_r29_r31,r10 */
1553 .size __save_r29_r31,.-__save_r29_r31
1555 /* Restore saved registers, deallocate stack and return to the user */
1556 /* Called via: jr __return_r29_r31 */
1558 .globl __return_r29_r31
1559 .type __return_r29_r31,@function
1565 .size __return_r29_r31,.-__return_r29_r31
1566 #endif /* L_save_29c */
1572 .type __save_r31,@function
1573 /* Allocate space and save register 31 on the stack. */
1574 /* Also allocate space for the argument save area. */
1575 /* Called via: jalr __save_r31,r10 */
1580 .size __save_r31,.-__save_r31
1582 /* Restore saved registers, deallocate stack and return to the user. */
1583 /* Called via: jr __return_r31 */
1586 .type __return_r31,@function
1591 .size __return_r31,.-__return_r31
1592 #endif /* L_save_31c */
1594 #ifdef L_save_varargs
1598 .type __save_r6_r9,@function
1599 /* Save registers 6 .. 9 on the stack for variable argument functions. */
1600 /* Called via: jalr __save_r6_r9,r10 */
1617 .size __save_r6_r9,.-__save_r6_r9
1618 #endif /* L_save_varargs */
1620 #ifdef L_save_interrupt
1623 .globl __save_interrupt
1624 .type __save_interrupt,@function
1625 /* Save registers r1, r4 on stack and load up with expected values. */
1626 /* Note, 12 bytes of stack have already been allocated. */
1627 /* Called via: jalr __save_interrupt,r10 */
1632 movhi hi(__ep),r0,ep
1633 movea lo(__ep),ep,ep
1634 movhi hi(__gp),r0,gp
1635 movea lo(__gp),gp,gp
1637 .size __save_interrupt,.-__save_interrupt
1639 /* Restore saved registers, deallocate stack and return from the interrupt. */
1640 /* Called via: jr __return_interrupt */
1642 .globl __return_interrupt
1643 .type __return_interrupt,@function
1651 .size __return_interrupt,.-__return_interrupt
1652 #endif /* L_save_interrupt */
1654 #ifdef L_save_all_interrupt
1657 .globl __save_all_interrupt
1658 .type __save_all_interrupt,@function
1659 /* Save all registers except for those saved in __save_interrupt. */
1660 /* Allocate enough stack for all of the registers & 16 bytes of space. */
1661 /* Called via: jalr __save_all_interrupt,r10 */
1662 __save_all_interrupt:
1723 .size __save_all_interrupt,.-__save_all_interrupt
1725 .globl __restore_all_interrupt
1726 .type __restore_all_interrupt,@function
1727 /* Restore all registers saved in __save_all_interrupt and
1728 deallocate the stack space. */
1729 /* Called via: jalr __restore_all_interrupt,r10 */
1730 __restore_all_interrupt:
1791 .size __restore_all_interrupt,.-__restore_all_interrupt
1792 #endif /* L_save_all_interrupt */
1795 #if defined __v850e__
1796 #ifdef L_callt_save_r2_r29
1797 /* Put these functions into the call table area. */
1800 /* Allocate space and save registers 2, 20 .. 29 on the stack. */
1801 /* Called via: callt ctoff(__callt_save_r2_r29). */
1806 prepare {r20 - r29}, 0
1809 /* Restore saved registers, deallocate stack and return to the user. */
1810 /* Called via: callt ctoff(__callt_return_r2_r29). */
1813 dispose 0, {r20-r29}
1818 /* Place the offsets of the start of these routines into the call table. */
1821 .global __callt_save_r2_r29
1822 .type __callt_save_r2_r29,@function
1823 __callt_save_r2_r29: .short ctoff(.L_save_r2_r29)
1825 .global __callt_return_r2_r29
1826 .type __callt_return_r2_r29,@function
1827 __callt_return_r2_r29: .short ctoff(.L_return_r2_r29)
1829 #endif /* L_callt_save_r2_r29 */
1831 #ifdef L_callt_save_r2_r31
1832 /* Put these functions into the call table area. */
1835 /* Allocate space and save registers 2 and 20 .. 29, 31 on the stack. */
1836 /* Also allocate space for the argument save area. */
1837 /* Called via: callt ctoff(__callt_save_r2_r31). */
1842 prepare {r20 - r29, r31}, 4
1845 /* Restore saved registers, deallocate stack and return to the user. */
1846 /* Called via: callt ctoff(__callt_return_r2_r31). */
1849 dispose 4, {r20 - r29, r31}
1854 /* Place the offsets of the start of these routines into the call table. */
1857 .global __callt_save_r2_r31
1858 .type __callt_save_r2_r31,@function
1859 __callt_save_r2_r31: .short ctoff(.L_save_r2_r31)
1861 .global __callt_return_r2_r31
1862 .type __callt_return_r2_r31,@function
1863 __callt_return_r2_r31: .short ctoff(.L_return_r2_r31)
1865 #endif /* L_callt_save_r2_r31 */
1868 #ifdef L_callt_save_r6_r9
1869 /* Put these functions into the call table area. */
1872 /* Save registers r6 - r9 onto the stack in the space reserved for them.
1873 Use by variable argument functions.
1874 Called via: callt ctoff(__callt_save_r6_r9). */
1893 /* Place the offsets of the start of this routines into the call table. */
1896 .global __callt_save_r6_r9
1897 .type __callt_save_r6_r9,@function
1898 __callt_save_r6_r9: .short ctoff(.L_save_r6_r9)
1899 #endif /* L_callt_save_r6_r9 */
1902 #ifdef L_callt_save_interrupt
1903 /* Put these functions into the call table area. */
1906 /* Save registers r1, ep, gp, r10 on stack and load up with expected values. */
1907 /* Called via: callt ctoff(__callt_save_interrupt). */
1910 /* SP has already been moved before callt ctoff(_save_interrupt). */
1911 /* addi -24, sp, sp */
1915 /* R10 has already been saved before callt ctoff(_save_interrupt). */
1916 /* st.w r10, 12[sp] */
1921 /* Restore saved registers, deallocate stack and return from the interrupt. */
1922 /* Called via: callt ctoff(__callt_restore_interrupt). */
1924 .globl __return_interrupt
1925 .type __return_interrupt,@function
1926 .L_return_interrupt:
1938 /* Place the offsets of the start of these routines into the call table. */
1941 .global __callt_save_interrupt
1942 .type __callt_save_interrupt,@function
1943 __callt_save_interrupt: .short ctoff(.L_save_interrupt)
1945 .global __callt_return_interrupt
1946 .type __callt_return_interrupt,@function
1947 __callt_return_interrupt: .short ctoff(.L_return_interrupt)
1949 #endif /* L_callt_save_interrupt */
1951 #ifdef L_callt_save_all_interrupt
1952 /* Put these functions into the call table area. */
1955 /* Save all registers except for those saved in __save_interrupt. */
1956 /* Allocate enough stack for all of the registers & 16 bytes of space. */
1957 /* Called via: callt ctoff(__callt_save_all_interrupt). */
1959 .L_save_all_interrupt:
1997 prepare {r20 - r29, r31}, 4
2000 /* Restore all registers saved in __save_all_interrupt
2001 deallocate the stack space. */
2002 /* Called via: callt ctoff(__callt_restore_all_interrupt). */
2004 .L_restore_all_interrupt:
2005 dispose 4, {r20 - r29, r31}
2045 /* Place the offsets of the start of these routines into the call table. */
2048 .global __callt_save_all_interrupt
2049 .type __callt_save_all_interrupt,@function
2050 __callt_save_all_interrupt: .short ctoff(.L_save_all_interrupt)
2052 .global __callt_restore_all_interrupt
2053 .type __callt_restore_all_interrupt,@function
2054 __callt_restore_all_interrupt: .short ctoff(.L_restore_all_interrupt)
2056 #endif /* L_callt_save_all_interrupt */
2059 #define MAKE_CALLT_FUNCS( START ) \
2062 /* Allocate space and save registers START .. r29 on the stack. */ ;\
2063 /* Called via: callt ctoff(__callt_save_START_r29). */ ;\
2064 .L_save_##START##_r29: ;\
2065 prepare { START - r29 }, 0 ;\
2068 /* Restore saved registers, deallocate stack and return. */ ;\
2069 /* Called via: callt ctoff(__return_START_r29) */ ;\
2071 .L_return_##START##_r29: ;\
2072 dispose 0, { START - r29 }, r31 ;\
2074 /* Place the offsets of the start of these funcs into the call table. */;\
2077 .global __callt_save_##START##_r29 ;\
2078 .type __callt_save_##START##_r29,@function ;\
2079 __callt_save_##START##_r29: .short ctoff(.L_save_##START##_r29 ) ;\
2081 .global __callt_return_##START##_r29 ;\
2082 .type __callt_return_##START##_r29,@function ;\
2083 __callt_return_##START##_r29: .short ctoff(.L_return_##START##_r29 )
2086 #define MAKE_CALLT_CFUNCS( START ) \
2089 /* Allocate space and save registers START .. r31 on the stack. */ ;\
2090 /* Called via: callt ctoff(__callt_save_START_r31c). */ ;\
2091 .L_save_##START##_r31c: ;\
2092 prepare { START - r29, r31}, 4 ;\
2095 /* Restore saved registers, deallocate stack and return. */ ;\
2096 /* Called via: callt ctoff(__return_START_r31c). */ ;\
2098 .L_return_##START##_r31c: ;\
2099 dispose 4, { START - r29, r31}, r31 ;\
2101 /* Place the offsets of the start of these funcs into the call table. */;\
2104 .global __callt_save_##START##_r31c ;\
2105 .type __callt_save_##START##_r31c,@function ;\
2106 __callt_save_##START##_r31c: .short ctoff(.L_save_##START##_r31c ) ;\
2108 .global __callt_return_##START##_r31c ;\
2109 .type __callt_return_##START##_r31c,@function ;\
2110 __callt_return_##START##_r31c: .short ctoff(.L_return_##START##_r31c )
2113 #ifdef L_callt_save_20
2114 MAKE_CALLT_FUNCS (r20)
2116 #ifdef L_callt_save_21
2117 MAKE_CALLT_FUNCS (r21)
2119 #ifdef L_callt_save_22
2120 MAKE_CALLT_FUNCS (r22)
2122 #ifdef L_callt_save_23
2123 MAKE_CALLT_FUNCS (r23)
2125 #ifdef L_callt_save_24
2126 MAKE_CALLT_FUNCS (r24)
2128 #ifdef L_callt_save_25
2129 MAKE_CALLT_FUNCS (r25)
2131 #ifdef L_callt_save_26
2132 MAKE_CALLT_FUNCS (r26)
2134 #ifdef L_callt_save_27
2135 MAKE_CALLT_FUNCS (r27)
2137 #ifdef L_callt_save_28
2138 MAKE_CALLT_FUNCS (r28)
2140 #ifdef L_callt_save_29
2141 MAKE_CALLT_FUNCS (r29)
2144 #ifdef L_callt_save_20c
2145 MAKE_CALLT_CFUNCS (r20)
2147 #ifdef L_callt_save_21c
2148 MAKE_CALLT_CFUNCS (r21)
2150 #ifdef L_callt_save_22c
2151 MAKE_CALLT_CFUNCS (r22)
2153 #ifdef L_callt_save_23c
2154 MAKE_CALLT_CFUNCS (r23)
2156 #ifdef L_callt_save_24c
2157 MAKE_CALLT_CFUNCS (r24)
2159 #ifdef L_callt_save_25c
2160 MAKE_CALLT_CFUNCS (r25)
2162 #ifdef L_callt_save_26c
2163 MAKE_CALLT_CFUNCS (r26)
2165 #ifdef L_callt_save_27c
2166 MAKE_CALLT_CFUNCS (r27)
2168 #ifdef L_callt_save_28c
2169 MAKE_CALLT_CFUNCS (r28)
2171 #ifdef L_callt_save_29c
2172 MAKE_CALLT_CFUNCS (r29)
2176 #ifdef L_callt_save_31c
2179 /* Allocate space and save register r31 on the stack. */
2180 /* Called via: callt ctoff(__callt_save_r31c). */
2185 /* Restore saved registers, deallocate stack and return. */
2186 /* Called via: callt ctoff(__return_r31c). */
2188 .L_callt_return_r31c:
2189 dispose 4, {r31}, r31
2191 /* Place the offsets of the start of these funcs into the call table. */
2194 .global __callt_save_r31c
2195 .type __callt_save_r31c,@function
2196 __callt_save_r31c: .short ctoff(.L_callt_save_r31c)
2198 .global __callt_return_r31c
2199 .type __callt_return_r31c,@function
2200 __callt_return_r31c: .short ctoff(.L_callt_return_r31c)
2203 #endif /* __v850e__ */
2205 /* libgcc2 routines for NEC V850. */
2206 /* Double Integer Arithmetical Operation. */
2211 .type ___negdi2, @function
2220 .size ___negdi2,.-___negdi2
2226 .type ___cmpdi2,@function
2228 # Signed comparison bitween each high word.
2236 # Unsigned comparigon bitween each low word.
2242 .size ___cmpdi2, . - ___cmpdi2
2248 .type ___ucmpdi2,@function
2250 cmp r9, r7 # Check if each high word are same.
2251 bne .L_ucmpdi_check_psw
2252 cmp r8, r6 # Compare the word.
2253 .L_ucmpdi_check_psw:
2256 add r6, r10 # Add the result of comparison NL and comparison H.
2258 .size ___ucmpdi2, . - ___ucmpdi2
2264 .type ___muldi3,@function
2267 jarl __save_r26_r31, r10
2271 movea lo(32767), r0, r14
2348 movhi hi(131071), r0, r12
2349 movea lo(131071), r12, r13
2372 #endif /* __v850__ */
2373 #if defined(__v850e__) || defined(__v850ea__)
2374 /* (Ahi << 32 + Alo) * (Bhi << 32 + Blo) */
2377 mulu r7, r8, r0 /* Ahi * Blo */
2378 mulu r6, r9, r0 /* Alo * Bhi */
2379 mulu r6, r10, r11 /* Alo * Blo */
2384 #endif /* defined(__v850e__) || defined(__v850ea__) */
2385 .size ___muldi3, . - ___muldi3