1 /* libgcc routines for NEC V850.
2 Copyright (C) 1996, 1997, 2002, 2005, 2009 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 3, or (at your option) any
11 This file is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 Under Section 7 of GPL version 3, you are granted additional
17 permissions described in the GCC Runtime Library Exception, version
18 3.1, as published by the Free Software Foundation.
20 You should have received a copy of the GNU General Public License and
21 a copy of the GCC Runtime Library Exception along with this program;
22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 <http://www.gnu.org/licenses/>. */
28 .type ___mulsi3,@function
33 #define MASK ((1 << SHIFT) - 1)
37 short a_part = (a >> (i)) & MASK; \
38 short b_part = (b >> (j)) & MASK; \
39 int res = (((int) a_part) * ((int) b_part)); \
44 __mulsi3 (unsigned a, unsigned b)
47 ((STEP (SHIFT, 0) + STEP (0, SHIFT)) << SHIFT) +
48 ((STEP (0, 2 * SHIFT) + STEP (SHIFT, SHIFT) + STEP (2 * SHIFT, 0))
53 movea lo(32767), r0, r10
83 #if defined(__v850e__) || defined(__v850ea__)
84 /* This routine is almost unneccesarry because gcc
85 generates the MUL instruction for the RTX mulsi3.
86 But if someone wants to link his application with
87 previsously compiled v850 objects then they will
88 need this function. */
90 /* It isn't good to put the inst sequence as below;
93 In this case, there is a RAW hazard between them.
94 MUL inst takes 2 cycle in EX stage, then MOV inst
99 #endif /* __v850e__ */
100 .size ___mulsi3,.-___mulsi3
101 #endif /* L_mulsi3 */
107 .type ___udivsi3,@function
114 movhi hi(-2147483648),r0,r13
142 #else /* defined(__v850e__) */
144 /* See comments at end of __mulsi3. */
149 #endif /* __v850e__ */
151 .size ___udivsi3,.-___udivsi3
157 .type ___divsi3,@function
184 #else /* defined(__v850e__) */
186 /* See comments at end of __mulsi3. */
191 #endif /* __v850e__ */
193 .size ___divsi3,.-___divsi3
199 .type ___umodsi3,@function
216 #else /* defined(__v850e__) */
218 /* See comments at end of __mulsi3. */
222 #endif /* __v850e__ */
224 .size ___umodsi3,.-___umodsi3
225 #endif /* L_umodsi3 */
230 .type ___modsi3,@function
247 #else /* defined(__v850e__) */
249 /* See comments at end of __mulsi3. */
253 #endif /* __v850e__ */
255 .size ___modsi3,.-___modsi3
256 #endif /* L_modsi3 */
262 .type __save_r2_r29,@function
263 /* Allocate space and save registers 2, 20 .. 29 on the stack */
264 /* Called via: jalr __save_r2_r29,r10 */
297 .size __save_r2_r29,.-__save_r2_r29
299 /* Restore saved registers, deallocate stack and return to the user */
300 /* Called via: jr __return_r2_r29 */
302 .globl __return_r2_r29
303 .type __return_r2_r29,@function
336 .size __return_r2_r29,.-__return_r2_r29
337 #endif /* L_save_2 */
342 .globl __save_r20_r29
343 .type __save_r20_r29,@function
344 /* Allocate space and save registers 20 .. 29 on the stack */
345 /* Called via: jalr __save_r20_r29,r10 */
376 .size __save_r20_r29,.-__save_r20_r29
378 /* Restore saved registers, deallocate stack and return to the user */
379 /* Called via: jr __return_r20_r29 */
381 .globl __return_r20_r29
382 .type __return_r20_r29,@function
413 .size __return_r20_r29,.-__return_r20_r29
414 #endif /* L_save_20 */
419 .globl __save_r21_r29
420 .type __save_r21_r29,@function
421 /* Allocate space and save registers 21 .. 29 on the stack */
422 /* Called via: jalr __save_r21_r29,r10 */
451 .size __save_r21_r29,.-__save_r21_r29
453 /* Restore saved registers, deallocate stack and return to the user */
454 /* Called via: jr __return_r21_r29 */
456 .globl __return_r21_r29
457 .type __return_r21_r29,@function
486 .size __return_r21_r29,.-__return_r21_r29
487 #endif /* L_save_21 */
492 .globl __save_r22_r29
493 .type __save_r22_r29,@function
494 /* Allocate space and save registers 22 .. 29 on the stack */
495 /* Called via: jalr __save_r22_r29,r10 */
522 .size __save_r22_r29,.-__save_r22_r29
524 /* Restore saved registers, deallocate stack and return to the user */
525 /* Called via: jr __return_r22_r29 */
527 .globl __return_r22_r29
528 .type __return_r22_r29,@function
555 .size __return_r22_r29,.-__return_r22_r29
556 #endif /* L_save_22 */
561 .globl __save_r23_r29
562 .type __save_r23_r29,@function
563 /* Allocate space and save registers 23 .. 29 on the stack */
564 /* Called via: jalr __save_r23_r29,r10 */
589 .size __save_r23_r29,.-__save_r23_r29
591 /* Restore saved registers, deallocate stack and return to the user */
592 /* Called via: jr __return_r23_r29 */
594 .globl __return_r23_r29
595 .type __return_r23_r29,@function
620 .size __return_r23_r29,.-__return_r23_r29
621 #endif /* L_save_23 */
626 .globl __save_r24_r29
627 .type __save_r24_r29,@function
628 /* Allocate space and save registers 24 .. 29 on the stack */
629 /* Called via: jalr __save_r24_r29,r10 */
652 .size __save_r24_r29,.-__save_r24_r29
654 /* Restore saved registers, deallocate stack and return to the user */
655 /* Called via: jr __return_r24_r29 */
657 .globl __return_r24_r29
658 .type __return_r24_r29,@function
681 .size __return_r24_r29,.-__return_r24_r29
682 #endif /* L_save_24 */
687 .globl __save_r25_r29
688 .type __save_r25_r29,@function
689 /* Allocate space and save registers 25 .. 29 on the stack */
690 /* Called via: jalr __save_r25_r29,r10 */
711 .size __save_r25_r29,.-__save_r25_r29
713 /* Restore saved registers, deallocate stack and return to the user */
714 /* Called via: jr __return_r25_r29 */
716 .globl __return_r25_r29
717 .type __return_r25_r29,@function
738 .size __return_r25_r29,.-__return_r25_r29
739 #endif /* L_save_25 */
744 .globl __save_r26_r29
745 .type __save_r26_r29,@function
746 /* Allocate space and save registers 26 .. 29 on the stack */
747 /* Called via: jalr __save_r26_r29,r10 */
766 .size __save_r26_r29,.-__save_r26_r29
768 /* Restore saved registers, deallocate stack and return to the user */
769 /* Called via: jr __return_r26_r29 */
771 .globl __return_r26_r29
772 .type __return_r26_r29,@function
791 .size __return_r26_r29,.-__return_r26_r29
792 #endif /* L_save_26 */
797 .globl __save_r27_r29
798 .type __save_r27_r29,@function
799 /* Allocate space and save registers 27 .. 29 on the stack */
800 /* Called via: jalr __save_r27_r29,r10 */
807 .size __save_r27_r29,.-__save_r27_r29
809 /* Restore saved registers, deallocate stack and return to the user */
810 /* Called via: jr __return_r27_r29 */
812 .globl __return_r27_r29
813 .type __return_r27_r29,@function
820 .size __return_r27_r29,.-__return_r27_r29
821 #endif /* L_save_27 */
826 .globl __save_r28_r29
827 .type __save_r28_r29,@function
828 /* Allocate space and save registers 28,29 on the stack */
829 /* Called via: jalr __save_r28_r29,r10 */
835 .size __save_r28_r29,.-__save_r28_r29
837 /* Restore saved registers, deallocate stack and return to the user */
838 /* Called via: jr __return_r28_r29 */
840 .globl __return_r28_r29
841 .type __return_r28_r29,@function
847 .size __return_r28_r29,.-__return_r28_r29
848 #endif /* L_save_28 */
854 .type __save_r29,@function
855 /* Allocate space and save register 29 on the stack */
856 /* Called via: jalr __save_r29,r10 */
861 .size __save_r29,.-__save_r29
863 /* Restore saved register 29, deallocate stack and return to the user */
864 /* Called via: jr __return_r29 */
867 .type __return_r29,@function
872 .size __return_r29,.-__return_r29
873 #endif /* L_save_28 */
879 .type __save_r2_r31,@function
880 /* Allocate space and save registers 20 .. 29, 31 on the stack. */
881 /* Also allocate space for the argument save area. */
882 /* Called via: jalr __save_r2_r31,r10. */
917 .size __save_r2_r31,.-__save_r2_r31
919 /* Restore saved registers, deallocate stack and return to the user */
920 /* Called via: jr __return_r20_r31 */
922 .globl __return_r2_r31
923 .type __return_r2_r31,@function
958 .size __return_r2_r31,.-__return_r2_r31
959 #endif /* L_save_2c */
964 .globl __save_r20_r31
965 .type __save_r20_r31,@function
966 /* Allocate space and save registers 20 .. 29, 31 on the stack */
967 /* Also allocate space for the argument save area */
968 /* Called via: jalr __save_r20_r31,r10 */
1001 .size __save_r20_r31,.-__save_r20_r31
1003 /* Restore saved registers, deallocate stack and return to the user */
1004 /* Called via: jr __return_r20_r31 */
1006 .globl __return_r20_r31
1007 .type __return_r20_r31,@function
1040 .size __return_r20_r31,.-__return_r20_r31
1041 #endif /* L_save_20c */
1046 .globl __save_r21_r31
1047 .type __save_r21_r31,@function
1048 /* Allocate space and save registers 21 .. 29, 31 on the stack */
1049 /* Also allocate space for the argument save area */
1050 /* Called via: jalr __save_r21_r31,r10 */
1081 .size __save_r21_r31,.-__save_r21_r31
1083 /* Restore saved registers, deallocate stack and return to the user */
1084 /* Called via: jr __return_r21_r31 */
1086 .globl __return_r21_r31
1087 .type __return_r21_r31,@function
1118 .size __return_r21_r31,.-__return_r21_r31
1119 #endif /* L_save_21c */
1124 .globl __save_r22_r31
1125 .type __save_r22_r31,@function
1126 /* Allocate space and save registers 22 .. 29, 31 on the stack */
1127 /* Also allocate space for the argument save area */
1128 /* Called via: jalr __save_r22_r31,r10 */
1157 .size __save_r22_r31,.-__save_r22_r31
1159 /* Restore saved registers, deallocate stack and return to the user */
1160 /* Called via: jr __return_r22_r31 */
1162 .globl __return_r22_r31
1163 .type __return_r22_r31,@function
1192 .size __return_r22_r31,.-__return_r22_r31
1193 #endif /* L_save_22c */
1198 .globl __save_r23_r31
1199 .type __save_r23_r31,@function
1200 /* Allocate space and save registers 23 .. 29, 31 on the stack */
1201 /* Also allocate space for the argument save area */
1202 /* Called via: jalr __save_r23_r31,r10 */
1229 .size __save_r23_r31,.-__save_r23_r31
1231 /* Restore saved registers, deallocate stack and return to the user */
1232 /* Called via: jr __return_r23_r31 */
1234 .globl __return_r23_r31
1235 .type __return_r23_r31,@function
1262 .size __return_r23_r31,.-__return_r23_r31
1263 #endif /* L_save_23c */
1268 .globl __save_r24_r31
1269 .type __save_r24_r31,@function
1270 /* Allocate space and save registers 24 .. 29, 31 on the stack */
1271 /* Also allocate space for the argument save area */
1272 /* Called via: jalr __save_r24_r31,r10 */
1297 .size __save_r24_r31,.-__save_r24_r31
1299 /* Restore saved registers, deallocate stack and return to the user */
1300 /* Called via: jr __return_r24_r31 */
1302 .globl __return_r24_r31
1303 .type __return_r24_r31,@function
1328 .size __return_r24_r31,.-__return_r24_r31
1329 #endif /* L_save_24c */
1334 .globl __save_r25_r31
1335 .type __save_r25_r31,@function
1336 /* Allocate space and save registers 25 .. 29, 31 on the stack */
1337 /* Also allocate space for the argument save area */
1338 /* Called via: jalr __save_r25_r31,r10 */
1361 .size __save_r25_r31,.-__save_r25_r31
1363 /* Restore saved registers, deallocate stack and return to the user */
1364 /* Called via: jr __return_r25_r31 */
1366 .globl __return_r25_r31
1367 .type __return_r25_r31,@function
1390 .size __return_r25_r31,.-__return_r25_r31
1391 #endif /* L_save_25c */
1396 .globl __save_r26_r31
1397 .type __save_r26_r31,@function
1398 /* Allocate space and save registers 26 .. 29, 31 on the stack */
1399 /* Also allocate space for the argument save area */
1400 /* Called via: jalr __save_r26_r31,r10 */
1421 .size __save_r26_r31,.-__save_r26_r31
1423 /* Restore saved registers, deallocate stack and return to the user */
1424 /* Called via: jr __return_r26_r31 */
1426 .globl __return_r26_r31
1427 .type __return_r26_r31,@function
1448 .size __return_r26_r31,.-__return_r26_r31
1449 #endif /* L_save_26c */
1454 .globl __save_r27_r31
1455 .type __save_r27_r31,@function
1456 /* Allocate space and save registers 27 .. 29, 31 on the stack */
1457 /* Also allocate space for the argument save area */
1458 /* Called via: jalr __save_r27_r31,r10 */
1477 .size __save_r27_r31,.-__save_r27_r31
1479 /* Restore saved registers, deallocate stack and return to the user */
1480 /* Called via: jr __return_r27_r31 */
1482 .globl __return_r27_r31
1483 .type __return_r27_r31,@function
1502 .size __return_r27_r31,.-__return_r27_r31
1503 #endif /* L_save_27c */
1508 .globl __save_r28_r31
1509 .type __save_r28_r31,@function
1510 /* Allocate space and save registers 28 .. 29, 31 on the stack */
1511 /* Also allocate space for the argument save area */
1512 /* Called via: jalr __save_r28_r31,r10 */
1519 .size __save_r28_r31,.-__save_r28_r31
1521 /* Restore saved registers, deallocate stack and return to the user */
1522 /* Called via: jr __return_r28_r31 */
1524 .globl __return_r28_r31
1525 .type __return_r28_r31,@function
1532 .size __return_r28_r31,.-__return_r28_r31
1533 #endif /* L_save_28c */
1538 .globl __save_r29_r31
1539 .type __save_r29_r31,@function
1540 /* Allocate space and save registers 29 & 31 on the stack */
1541 /* Also allocate space for the argument save area */
1542 /* Called via: jalr __save_r29_r31,r10 */
1548 .size __save_r29_r31,.-__save_r29_r31
1550 /* Restore saved registers, deallocate stack and return to the user */
1551 /* Called via: jr __return_r29_r31 */
1553 .globl __return_r29_r31
1554 .type __return_r29_r31,@function
1560 .size __return_r29_r31,.-__return_r29_r31
1561 #endif /* L_save_29c */
1567 .type __save_r31,@function
1568 /* Allocate space and save register 31 on the stack. */
1569 /* Also allocate space for the argument save area. */
1570 /* Called via: jalr __save_r31,r10 */
1575 .size __save_r31,.-__save_r31
1577 /* Restore saved registers, deallocate stack and return to the user. */
1578 /* Called via: jr __return_r31 */
1581 .type __return_r31,@function
1586 .size __return_r31,.-__return_r31
1587 #endif /* L_save_31c */
1589 #ifdef L_save_varargs
1593 .type __save_r6_r9,@function
1594 /* Save registers 6 .. 9 on the stack for variable argument functions. */
1595 /* Called via: jalr __save_r6_r9,r10 */
1612 .size __save_r6_r9,.-__save_r6_r9
1613 #endif /* L_save_varargs */
1615 #ifdef L_save_interrupt
1618 .globl __save_interrupt
1619 .type __save_interrupt,@function
1620 /* Save registers r1, r4 on stack and load up with expected values. */
1621 /* Note, 12 bytes of stack have already been allocated. */
1622 /* Called via: jalr __save_interrupt,r10 */
1627 movhi hi(__ep),r0,ep
1628 movea lo(__ep),ep,ep
1629 movhi hi(__gp),r0,gp
1630 movea lo(__gp),gp,gp
1632 .size __save_interrupt,.-__save_interrupt
1634 /* Restore saved registers, deallocate stack and return from the interrupt. */
1635 /* Called via: jr __return_interrupt */
1637 .globl __return_interrupt
1638 .type __return_interrupt,@function
1646 .size __return_interrupt,.-__return_interrupt
1647 #endif /* L_save_interrupt */
1649 #ifdef L_save_all_interrupt
1652 .globl __save_all_interrupt
1653 .type __save_all_interrupt,@function
1654 /* Save all registers except for those saved in __save_interrupt. */
1655 /* Allocate enough stack for all of the registers & 16 bytes of space. */
1656 /* Called via: jalr __save_all_interrupt,r10 */
1657 __save_all_interrupt:
1718 .size __save_all_interrupt,.-__save_all_interrupt
1720 .globl __restore_all_interrupt
1721 .type __restore_all_interrupt,@function
1722 /* Restore all registers saved in __save_all_interrupt and
1723 deallocate the stack space. */
1724 /* Called via: jalr __restore_all_interrupt,r10 */
1725 __restore_all_interrupt:
1786 .size __restore_all_interrupt,.-__restore_all_interrupt
1787 #endif /* L_save_all_interrupt */
1790 #if defined __v850e__
1791 #ifdef L_callt_save_r2_r29
1792 /* Put these functions into the call table area. */
1795 /* Allocate space and save registers 2, 20 .. 29 on the stack. */
1796 /* Called via: callt ctoff(__callt_save_r2_r29). */
1801 prepare {r20 - r29}, 0
1804 /* Restore saved registers, deallocate stack and return to the user. */
1805 /* Called via: callt ctoff(__callt_return_r2_r29). */
1808 dispose 0, {r20-r29}
1813 /* Place the offsets of the start of these routines into the call table. */
1816 .global __callt_save_r2_r29
1817 .type __callt_save_r2_r29,@function
1818 __callt_save_r2_r29: .short ctoff(.L_save_r2_r29)
1820 .global __callt_return_r2_r29
1821 .type __callt_return_r2_r29,@function
1822 __callt_return_r2_r29: .short ctoff(.L_return_r2_r29)
1824 #endif /* L_callt_save_r2_r29 */
1826 #ifdef L_callt_save_r2_r31
1827 /* Put these functions into the call table area. */
1830 /* Allocate space and save registers 2 and 20 .. 29, 31 on the stack. */
1831 /* Also allocate space for the argument save area. */
1832 /* Called via: callt ctoff(__callt_save_r2_r31). */
1837 prepare {r20 - r29, r31}, 4
1840 /* Restore saved registers, deallocate stack and return to the user. */
1841 /* Called via: callt ctoff(__callt_return_r2_r31). */
1844 dispose 4, {r20 - r29, r31}
1849 /* Place the offsets of the start of these routines into the call table. */
1852 .global __callt_save_r2_r31
1853 .type __callt_save_r2_r31,@function
1854 __callt_save_r2_r31: .short ctoff(.L_save_r2_r31)
1856 .global __callt_return_r2_r31
1857 .type __callt_return_r2_r31,@function
1858 __callt_return_r2_r31: .short ctoff(.L_return_r2_r31)
1860 #endif /* L_callt_save_r2_r31 */
1863 #ifdef L_callt_save_r6_r9
1864 /* Put these functions into the call table area. */
1867 /* Save registers r6 - r9 onto the stack in the space reserved for them.
1868 Use by variable argument functions.
1869 Called via: callt ctoff(__callt_save_r6_r9). */
1888 /* Place the offsets of the start of this routines into the call table. */
1891 .global __callt_save_r6_r9
1892 .type __callt_save_r6_r9,@function
1893 __callt_save_r6_r9: .short ctoff(.L_save_r6_r9)
1894 #endif /* L_callt_save_r6_r9 */
1897 #ifdef L_callt_save_interrupt
1898 /* Put these functions into the call table area. */
1901 /* Save registers r1, ep, gp, r10 on stack and load up with expected values. */
1902 /* Called via: callt ctoff(__callt_save_interrupt). */
1905 /* SP has already been moved before callt ctoff(_save_interrupt). */
1906 /* addi -24, sp, sp */
1910 /* R10 has already been saved before callt ctoff(_save_interrupt). */
1911 /* st.w r10, 12[sp] */
1916 /* Restore saved registers, deallocate stack and return from the interrupt. */
1917 /* Called via: callt ctoff(__callt_restore_interrupt). */
1919 .globl __return_interrupt
1920 .type __return_interrupt,@function
1921 .L_return_interrupt:
1933 /* Place the offsets of the start of these routines into the call table. */
1936 .global __callt_save_interrupt
1937 .type __callt_save_interrupt,@function
1938 __callt_save_interrupt: .short ctoff(.L_save_interrupt)
1940 .global __callt_return_interrupt
1941 .type __callt_return_interrupt,@function
1942 __callt_return_interrupt: .short ctoff(.L_return_interrupt)
1944 #endif /* L_callt_save_interrupt */
1946 #ifdef L_callt_save_all_interrupt
1947 /* Put these functions into the call table area. */
1950 /* Save all registers except for those saved in __save_interrupt. */
1951 /* Allocate enough stack for all of the registers & 16 bytes of space. */
1952 /* Called via: callt ctoff(__callt_save_all_interrupt). */
1954 .L_save_all_interrupt:
1992 prepare {r20 - r29, r31}, 4
1995 /* Restore all registers saved in __save_all_interrupt
1996 deallocate the stack space. */
1997 /* Called via: callt ctoff(__callt_restore_all_interrupt). */
1999 .L_restore_all_interrupt:
2000 dispose 4, {r20 - r29, r31}
2040 /* Place the offsets of the start of these routines into the call table. */
2043 .global __callt_save_all_interrupt
2044 .type __callt_save_all_interrupt,@function
2045 __callt_save_all_interrupt: .short ctoff(.L_save_all_interrupt)
2047 .global __callt_restore_all_interrupt
2048 .type __callt_restore_all_interrupt,@function
2049 __callt_restore_all_interrupt: .short ctoff(.L_restore_all_interrupt)
2051 #endif /* L_callt_save_all_interrupt */
2054 #define MAKE_CALLT_FUNCS( START ) \
2057 /* Allocate space and save registers START .. r29 on the stack. */ ;\
2058 /* Called via: callt ctoff(__callt_save_START_r29). */ ;\
2059 .L_save_##START##_r29: ;\
2060 prepare { START - r29 }, 0 ;\
2063 /* Restore saved registers, deallocate stack and return. */ ;\
2064 /* Called via: callt ctoff(__return_START_r29) */ ;\
2066 .L_return_##START##_r29: ;\
2067 dispose 0, { START - r29 }, r31 ;\
2069 /* Place the offsets of the start of these funcs into the call table. */;\
2072 .global __callt_save_##START##_r29 ;\
2073 .type __callt_save_##START##_r29,@function ;\
2074 __callt_save_##START##_r29: .short ctoff(.L_save_##START##_r29 ) ;\
2076 .global __callt_return_##START##_r29 ;\
2077 .type __callt_return_##START##_r29,@function ;\
2078 __callt_return_##START##_r29: .short ctoff(.L_return_##START##_r29 )
2081 #define MAKE_CALLT_CFUNCS( START ) \
2084 /* Allocate space and save registers START .. r31 on the stack. */ ;\
2085 /* Called via: callt ctoff(__callt_save_START_r31c). */ ;\
2086 .L_save_##START##_r31c: ;\
2087 prepare { START - r29, r31}, 4 ;\
2090 /* Restore saved registers, deallocate stack and return. */ ;\
2091 /* Called via: callt ctoff(__return_START_r31c). */ ;\
2093 .L_return_##START##_r31c: ;\
2094 dispose 4, { START - r29, r31}, r31 ;\
2096 /* Place the offsets of the start of these funcs into the call table. */;\
2099 .global __callt_save_##START##_r31c ;\
2100 .type __callt_save_##START##_r31c,@function ;\
2101 __callt_save_##START##_r31c: .short ctoff(.L_save_##START##_r31c ) ;\
2103 .global __callt_return_##START##_r31c ;\
2104 .type __callt_return_##START##_r31c,@function ;\
2105 __callt_return_##START##_r31c: .short ctoff(.L_return_##START##_r31c )
2108 #ifdef L_callt_save_20
2109 MAKE_CALLT_FUNCS (r20)
2111 #ifdef L_callt_save_21
2112 MAKE_CALLT_FUNCS (r21)
2114 #ifdef L_callt_save_22
2115 MAKE_CALLT_FUNCS (r22)
2117 #ifdef L_callt_save_23
2118 MAKE_CALLT_FUNCS (r23)
2120 #ifdef L_callt_save_24
2121 MAKE_CALLT_FUNCS (r24)
2123 #ifdef L_callt_save_25
2124 MAKE_CALLT_FUNCS (r25)
2126 #ifdef L_callt_save_26
2127 MAKE_CALLT_FUNCS (r26)
2129 #ifdef L_callt_save_27
2130 MAKE_CALLT_FUNCS (r27)
2132 #ifdef L_callt_save_28
2133 MAKE_CALLT_FUNCS (r28)
2135 #ifdef L_callt_save_29
2136 MAKE_CALLT_FUNCS (r29)
2139 #ifdef L_callt_save_20c
2140 MAKE_CALLT_CFUNCS (r20)
2142 #ifdef L_callt_save_21c
2143 MAKE_CALLT_CFUNCS (r21)
2145 #ifdef L_callt_save_22c
2146 MAKE_CALLT_CFUNCS (r22)
2148 #ifdef L_callt_save_23c
2149 MAKE_CALLT_CFUNCS (r23)
2151 #ifdef L_callt_save_24c
2152 MAKE_CALLT_CFUNCS (r24)
2154 #ifdef L_callt_save_25c
2155 MAKE_CALLT_CFUNCS (r25)
2157 #ifdef L_callt_save_26c
2158 MAKE_CALLT_CFUNCS (r26)
2160 #ifdef L_callt_save_27c
2161 MAKE_CALLT_CFUNCS (r27)
2163 #ifdef L_callt_save_28c
2164 MAKE_CALLT_CFUNCS (r28)
2166 #ifdef L_callt_save_29c
2167 MAKE_CALLT_CFUNCS (r29)
2171 #ifdef L_callt_save_31c
2174 /* Allocate space and save register r31 on the stack. */
2175 /* Called via: callt ctoff(__callt_save_r31c). */
2180 /* Restore saved registers, deallocate stack and return. */
2181 /* Called via: callt ctoff(__return_r31c). */
2183 .L_callt_return_r31c:
2184 dispose 4, {r31}, r31
2186 /* Place the offsets of the start of these funcs into the call table. */
2189 .global __callt_save_r31c
2190 .type __callt_save_r31c,@function
2191 __callt_save_r31c: .short ctoff(.L_callt_save_r31c)
2193 .global __callt_return_r31c
2194 .type __callt_return_r31c,@function
2195 __callt_return_r31c: .short ctoff(.L_callt_return_r31c)
2198 #endif /* __v850e__ */
2200 /* libgcc2 routines for NEC V850. */
2201 /* Double Integer Arithmetical Operation. */
2206 .type ___negdi2, @function
2215 .size ___negdi2,.-___negdi2
2221 .type ___cmpdi2,@function
2223 # Signed comparison bitween each high word.
2231 # Unsigned comparigon bitween each low word.
2237 .size ___cmpdi2, . - ___cmpdi2
2243 .type ___ucmpdi2,@function
2245 cmp r9, r7 # Check if each high word are same.
2246 bne .L_ucmpdi_check_psw
2247 cmp r8, r6 # Compare the word.
2248 .L_ucmpdi_check_psw:
2251 add r6, r10 # Add the result of comparison NL and comparison H.
2253 .size ___ucmpdi2, . - ___ucmpdi2
2259 .type ___muldi3,@function
2262 jarl __save_r26_r31, r10
2266 movea lo(32767), r0, r14
2343 movhi hi(131071), r0, r12
2344 movea lo(131071), r12, r13
2367 #endif /* __v850__ */
2368 #if defined(__v850e__) || defined(__v850ea__)
2369 /* (Ahi << 32 + Alo) * (Bhi << 32 + Blo) */
2372 mulu r7, r8, r0 /* Ahi * Blo */
2373 mulu r6, r9, r0 /* Alo * Bhi */
2374 mulu r6, r10, r11 /* Alo * Blo */
2379 #endif /* defined(__v850e__) || defined(__v850ea__) */
2380 .size ___muldi3, . - ___muldi3