1 /* libgcc routines for NEC V850.
2 Copyright (C) 1996-2017 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__) || defined(__v850e2__) || defined(__v850e2v3__) || defined(__v850e3v5__)
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. */
1082 .size __save_r21_r31,.-__save_r21_r31
1084 /* Restore saved registers, deallocate stack and return to the user. */
1085 /* Called via: jr __return_r21_r31. */
1087 .globl __return_r21_r31
1088 .type __return_r21_r31,@function
1119 .size __return_r21_r31,.-__return_r21_r31
1120 #endif /* L_save_21c */
1125 .globl __save_r22_r31
1126 .type __save_r22_r31,@function
1127 /* Allocate space and save registers 22 .. 29, 31 on the stack. */
1128 /* Also allocate space for the argument save area. */
1129 /* Called via: jalr __save_r22_r31,r10. */
1158 .size __save_r22_r31,.-__save_r22_r31
1160 /* Restore saved registers, deallocate stack and return to the user. */
1161 /* Called via: jr __return_r22_r31. */
1163 .globl __return_r22_r31
1164 .type __return_r22_r31,@function
1193 .size __return_r22_r31,.-__return_r22_r31
1194 #endif /* L_save_22c */
1199 .globl __save_r23_r31
1200 .type __save_r23_r31,@function
1201 /* Allocate space and save registers 23 .. 29, 31 on the stack. */
1202 /* Also allocate space for the argument save area. */
1203 /* Called via: jalr __save_r23_r31,r10. */
1230 .size __save_r23_r31,.-__save_r23_r31
1232 /* Restore saved registers, deallocate stack and return to the user. */
1233 /* Called via: jr __return_r23_r31. */
1235 .globl __return_r23_r31
1236 .type __return_r23_r31,@function
1263 .size __return_r23_r31,.-__return_r23_r31
1264 #endif /* L_save_23c */
1269 .globl __save_r24_r31
1270 .type __save_r24_r31,@function
1271 /* Allocate space and save registers 24 .. 29, 31 on the stack. */
1272 /* Also allocate space for the argument save area. */
1273 /* Called via: jalr __save_r24_r31,r10. */
1298 .size __save_r24_r31,.-__save_r24_r31
1300 /* Restore saved registers, deallocate stack and return to the user. */
1301 /* Called via: jr __return_r24_r31. */
1303 .globl __return_r24_r31
1304 .type __return_r24_r31,@function
1329 .size __return_r24_r31,.-__return_r24_r31
1330 #endif /* L_save_24c */
1335 .globl __save_r25_r31
1336 .type __save_r25_r31,@function
1337 /* Allocate space and save registers 25 .. 29, 31 on the stack. */
1338 /* Also allocate space for the argument save area. */
1339 /* Called via: jalr __save_r25_r31,r10. */
1362 .size __save_r25_r31,.-__save_r25_r31
1364 /* Restore saved registers, deallocate stack and return to the user. */
1365 /* Called via: jr __return_r25_r31. */
1367 .globl __return_r25_r31
1368 .type __return_r25_r31,@function
1391 .size __return_r25_r31,.-__return_r25_r31
1392 #endif /* L_save_25c */
1397 .globl __save_r26_r31
1398 .type __save_r26_r31,@function
1399 /* Allocate space and save registers 26 .. 29, 31 on the stack. */
1400 /* Also allocate space for the argument save area. */
1401 /* Called via: jalr __save_r26_r31,r10. */
1422 .size __save_r26_r31,.-__save_r26_r31
1424 /* Restore saved registers, deallocate stack and return to the user. */
1425 /* Called via: jr __return_r26_r31. */
1427 .globl __return_r26_r31
1428 .type __return_r26_r31,@function
1449 .size __return_r26_r31,.-__return_r26_r31
1450 #endif /* L_save_26c */
1455 .globl __save_r27_r31
1456 .type __save_r27_r31,@function
1457 /* Allocate space and save registers 27 .. 29, 31 on the stack. */
1458 /* Also allocate space for the argument save area. */
1459 /* Called via: jalr __save_r27_r31,r10. */
1478 .size __save_r27_r31,.-__save_r27_r31
1480 /* Restore saved registers, deallocate stack and return to the user. */
1481 /* Called via: jr __return_r27_r31. */
1483 .globl __return_r27_r31
1484 .type __return_r27_r31,@function
1503 .size __return_r27_r31,.-__return_r27_r31
1504 #endif /* L_save_27c */
1509 .globl __save_r28_r31
1510 .type __save_r28_r31,@function
1511 /* Allocate space and save registers 28 .. 29, 31 on the stack. */
1512 /* Also allocate space for the argument save area. */
1513 /* Called via: jalr __save_r28_r31,r10. */
1520 .size __save_r28_r31,.-__save_r28_r31
1522 /* Restore saved registers, deallocate stack and return to the user. */
1523 /* Called via: jr __return_r28_r31. */
1525 .globl __return_r28_r31
1526 .type __return_r28_r31,@function
1533 .size __return_r28_r31,.-__return_r28_r31
1534 #endif /* L_save_28c */
1539 .globl __save_r29_r31
1540 .type __save_r29_r31,@function
1541 /* Allocate space and save registers 29 & 31 on the stack. */
1542 /* Also allocate space for the argument save area. */
1543 /* Called via: jalr __save_r29_r31,r10. */
1549 .size __save_r29_r31,.-__save_r29_r31
1551 /* Restore saved registers, deallocate stack and return to the user. */
1552 /* Called via: jr __return_r29_r31. */
1554 .globl __return_r29_r31
1555 .type __return_r29_r31,@function
1561 .size __return_r29_r31,.-__return_r29_r31
1562 #endif /* L_save_29c */
1568 .type __save_r31,@function
1569 /* Allocate space and save register 31 on the stack. */
1570 /* Also allocate space for the argument save area. */
1571 /* Called via: jalr __save_r31,r10. */
1576 .size __save_r31,.-__save_r31
1578 /* Restore saved registers, deallocate stack and return to the user. */
1579 /* Called via: jr __return_r31. */
1582 .type __return_r31,@function
1587 .size __return_r31,.-__return_r31
1588 #endif /* L_save_31c */
1590 #ifdef L_save_interrupt
1593 .globl __save_interrupt
1594 .type __save_interrupt,@function
1595 /* Save registers r1, r4 on stack and load up with expected values. */
1596 /* Note, 20 bytes of stack have already been allocated. */
1597 /* Called via: jalr __save_interrupt,r10. */
1599 /* add -20,sp ; st.w r11,16[sp] ; st.w r10,12[sp] ; */
1603 movhi hi(__ep),r0,ep
1604 movea lo(__ep),ep,ep
1605 movhi hi(__gp),r0,gp
1606 movea lo(__gp),gp,gp
1608 .size __save_interrupt,.-__save_interrupt
1610 /* Restore saved registers, deallocate stack and return from the interrupt. */
1611 /* Called via: jr __return_interrupt. */
1613 .globl __return_interrupt
1614 .type __return_interrupt,@function
1623 .size __return_interrupt,.-__return_interrupt
1624 #endif /* L_save_interrupt */
1626 #ifdef L_save_all_interrupt
1629 .globl __save_all_interrupt
1630 .type __save_all_interrupt,@function
1631 /* Save all registers except for those saved in __save_interrupt. */
1632 /* Allocate enough stack for all of the registers & 16 bytes of space. */
1633 /* Called via: jalr __save_all_interrupt,r10. */
1634 __save_all_interrupt:
1695 .size __save_all_interrupt,.-__save_all_interrupt
1697 .globl __restore_all_interrupt
1698 .type __restore_all_interrupt,@function
1699 /* Restore all registers saved in __save_all_interrupt and
1700 deallocate the stack space. */
1701 /* Called via: jalr __restore_all_interrupt,r10. */
1702 __restore_all_interrupt:
1763 .size __restore_all_interrupt,.-__restore_all_interrupt
1764 #endif /* L_save_all_interrupt */
1766 #if defined __V850_CALLT__
1767 #if defined(__v850e__) || defined(__v850e1__) || defined(__v850e2__) || defined(__v850e2v3__) || defined(__v850e3v5__)
1768 #ifdef L_callt_save_r2_r29
1769 /* Put these functions into the call table area. */
1772 /* Allocate space and save registers 2, 20 .. 29 on the stack. */
1773 /* Called via: callt ctoff(__callt_save_r2_r29). */
1778 prepare {r20 - r29}, 0
1781 /* Restore saved registers, deallocate stack and return to the user. */
1782 /* Called via: callt ctoff(__callt_return_r2_r29). */
1785 dispose 0, {r20-r29}
1790 /* Place the offsets of the start of these routines into the call table. */
1793 .global __callt_save_r2_r29
1794 .type __callt_save_r2_r29,@function
1795 __callt_save_r2_r29: .short ctoff(.L_save_r2_r29)
1797 .global __callt_return_r2_r29
1798 .type __callt_return_r2_r29,@function
1799 __callt_return_r2_r29: .short ctoff(.L_return_r2_r29)
1801 #endif /* L_callt_save_r2_r29. */
1803 #ifdef L_callt_save_r2_r31
1804 /* Put these functions into the call table area. */
1807 /* Allocate space and save registers 2 and 20 .. 29, 31 on the stack. */
1808 /* Also allocate space for the argument save area. */
1809 /* Called via: callt ctoff(__callt_save_r2_r31). */
1814 prepare {r20 - r29, r31}, 0
1817 /* Restore saved registers, deallocate stack and return to the user. */
1818 /* Called via: callt ctoff(__callt_return_r2_r31). */
1821 dispose 0, {r20 - r29, r31}
1826 /* Place the offsets of the start of these routines into the call table. */
1829 .global __callt_save_r2_r31
1830 .type __callt_save_r2_r31,@function
1831 __callt_save_r2_r31: .short ctoff(.L_save_r2_r31)
1833 .global __callt_return_r2_r31
1834 .type __callt_return_r2_r31,@function
1835 __callt_return_r2_r31: .short ctoff(.L_return_r2_r31)
1837 #endif /* L_callt_save_r2_r31 */
1839 #ifdef L_callt_save_interrupt
1840 /* Put these functions into the call table area. */
1843 /* Save registers r1, ep, gp, r10 on stack and load up with expected values. */
1844 /* Called via: callt ctoff(__callt_save_interrupt). */
1847 /* SP has already been moved before callt ctoff(_save_interrupt). */
1848 /* R1,R10,R11,ctpc,ctpsw has alread been saved bofore callt ctoff(_save_interrupt). */
1849 /* addi -28, sp, sp */
1850 /* st.w r1, 24[sp] */
1851 /* st.w r10, 12[sp] */
1852 /* st.w r11, 16[sp] */
1853 /* stsr ctpc, r10 */
1854 /* st.w r10, 20[sp] */
1855 /* stsr ctpsw, r10 */
1856 /* st.w r10, 24[sp] */
1865 /* Restore saved registers, deallocate stack and return from the interrupt. */
1866 /* Called via: callt ctoff(__callt_restore_interrupt). */
1868 .globl __return_interrupt
1869 .type __return_interrupt,@function
1870 .L_return_interrupt:
1883 /* Place the offsets of the start of these routines into the call table. */
1886 .global __callt_save_interrupt
1887 .type __callt_save_interrupt,@function
1888 __callt_save_interrupt: .short ctoff(.L_save_interrupt)
1890 .global __callt_return_interrupt
1891 .type __callt_return_interrupt,@function
1892 __callt_return_interrupt: .short ctoff(.L_return_interrupt)
1894 #endif /* L_callt_save_interrupt */
1896 #ifdef L_callt_save_all_interrupt
1897 /* Put these functions into the call table area. */
1900 /* Save all registers except for those saved in __save_interrupt. */
1901 /* Allocate enough stack for all of the registers & 16 bytes of space. */
1902 /* Called via: callt ctoff(__callt_save_all_interrupt). */
1904 .L_save_all_interrupt:
1942 prepare {r20 - r29, r31}, 0
1945 /* Restore all registers saved in __save_all_interrupt
1946 deallocate the stack space. */
1947 /* Called via: callt ctoff(__callt_restore_all_interrupt). */
1949 .L_restore_all_interrupt:
1950 dispose 0, {r20 - r29, r31}
1990 /* Place the offsets of the start of these routines into the call table. */
1993 .global __callt_save_all_interrupt
1994 .type __callt_save_all_interrupt,@function
1995 __callt_save_all_interrupt: .short ctoff(.L_save_all_interrupt)
1997 .global __callt_restore_all_interrupt
1998 .type __callt_restore_all_interrupt,@function
1999 __callt_restore_all_interrupt: .short ctoff(.L_restore_all_interrupt)
2001 #endif /* L_callt_save_all_interrupt */
2004 #define MAKE_CALLT_FUNCS( START ) \
2007 /* Allocate space and save registers START .. r29 on the stack. */ ;\
2008 /* Called via: callt ctoff(__callt_save_START_r29). */ ;\
2009 .L_save_##START##_r29: ;\
2010 prepare { START - r29 }, 0 ;\
2013 /* Restore saved registers, deallocate stack and return. */ ;\
2014 /* Called via: callt ctoff(__return_START_r29). */ ;\
2016 .L_return_##START##_r29: ;\
2017 dispose 0, { START - r29 }, r31 ;\
2019 /* Place the offsets of the start of these funcs into the call table. */;\
2022 .global __callt_save_##START##_r29 ;\
2023 .type __callt_save_##START##_r29,@function ;\
2024 __callt_save_##START##_r29: .short ctoff(.L_save_##START##_r29 ) ;\
2026 .global __callt_return_##START##_r29 ;\
2027 .type __callt_return_##START##_r29,@function ;\
2028 __callt_return_##START##_r29: .short ctoff(.L_return_##START##_r29 )
2031 #define MAKE_CALLT_CFUNCS( START ) \
2034 /* Allocate space and save registers START .. r31 on the stack. */ ;\
2035 /* Called via: callt ctoff(__callt_save_START_r31c). */ ;\
2036 .L_save_##START##_r31c: ;\
2037 prepare { START - r29, r31}, 0 ;\
2040 /* Restore saved registers, deallocate stack and return. */ ;\
2041 /* Called via: callt ctoff(__return_START_r31c). */ ;\
2043 .L_return_##START##_r31c: ;\
2044 dispose 0, { START - r29, r31}, r31 ;\
2046 /* Place the offsets of the start of these funcs into the call table. */;\
2049 .global __callt_save_##START##_r31c ;\
2050 .type __callt_save_##START##_r31c,@function ;\
2051 __callt_save_##START##_r31c: .short ctoff(.L_save_##START##_r31c ) ;\
2053 .global __callt_return_##START##_r31c ;\
2054 .type __callt_return_##START##_r31c,@function ;\
2055 __callt_return_##START##_r31c: .short ctoff(.L_return_##START##_r31c )
2058 #ifdef L_callt_save_20
2059 MAKE_CALLT_FUNCS (r20)
2061 #ifdef L_callt_save_21
2062 MAKE_CALLT_FUNCS (r21)
2064 #ifdef L_callt_save_22
2065 MAKE_CALLT_FUNCS (r22)
2067 #ifdef L_callt_save_23
2068 MAKE_CALLT_FUNCS (r23)
2070 #ifdef L_callt_save_24
2071 MAKE_CALLT_FUNCS (r24)
2073 #ifdef L_callt_save_25
2074 MAKE_CALLT_FUNCS (r25)
2076 #ifdef L_callt_save_26
2077 MAKE_CALLT_FUNCS (r26)
2079 #ifdef L_callt_save_27
2080 MAKE_CALLT_FUNCS (r27)
2082 #ifdef L_callt_save_28
2083 MAKE_CALLT_FUNCS (r28)
2085 #ifdef L_callt_save_29
2086 MAKE_CALLT_FUNCS (r29)
2089 #ifdef L_callt_save_20c
2090 MAKE_CALLT_CFUNCS (r20)
2092 #ifdef L_callt_save_21c
2093 MAKE_CALLT_CFUNCS (r21)
2095 #ifdef L_callt_save_22c
2096 MAKE_CALLT_CFUNCS (r22)
2098 #ifdef L_callt_save_23c
2099 MAKE_CALLT_CFUNCS (r23)
2101 #ifdef L_callt_save_24c
2102 MAKE_CALLT_CFUNCS (r24)
2104 #ifdef L_callt_save_25c
2105 MAKE_CALLT_CFUNCS (r25)
2107 #ifdef L_callt_save_26c
2108 MAKE_CALLT_CFUNCS (r26)
2110 #ifdef L_callt_save_27c
2111 MAKE_CALLT_CFUNCS (r27)
2113 #ifdef L_callt_save_28c
2114 MAKE_CALLT_CFUNCS (r28)
2116 #ifdef L_callt_save_29c
2117 MAKE_CALLT_CFUNCS (r29)
2121 #ifdef L_callt_save_31c
2124 /* Allocate space and save register r31 on the stack. */
2125 /* Called via: callt ctoff(__callt_save_r31c). */
2130 /* Restore saved registers, deallocate stack and return. */
2131 /* Called via: callt ctoff(__return_r31c). */
2133 .L_callt_return_r31c:
2134 dispose 0, {r31}, r31
2136 /* Place the offsets of the start of these funcs into the call table. */
2139 .global __callt_save_r31c
2140 .type __callt_save_r31c,@function
2141 __callt_save_r31c: .short ctoff(.L_callt_save_r31c)
2143 .global __callt_return_r31c
2144 .type __callt_return_r31c,@function
2145 __callt_return_r31c: .short ctoff(.L_callt_return_r31c)
2148 #endif /* __v850e__ + */
2149 #endif /* __V850_CALLT__ */
2151 /* libgcc2 routines for NEC V850. */
2152 /* Double Integer Arithmetical Operation. */
2157 .type ___negdi2, @function
2166 .size ___negdi2,.-___negdi2
2172 .type ___cmpdi2,@function
2174 # Signed comparison bitween each high word.
2182 # Unsigned comparigon bitween each low word.
2188 .size ___cmpdi2, . - ___cmpdi2
2194 .type ___ucmpdi2,@function
2196 cmp r9, r7 # Check if each high word are same.
2197 bne .L_ucmpdi_check_psw
2198 cmp r8, r6 # Compare the word.
2199 .L_ucmpdi_check_psw:
2202 add r6, r10 # Add the result of comparison NL and comparison H.
2204 .size ___ucmpdi2, . - ___ucmpdi2
2210 .type ___muldi3,@function
2213 jarl __save_r26_r31, r10
2217 movea lo(32767), r0, r14
2294 movhi hi(131071), r0, r12
2295 movea lo(131071), r12, r13
2318 #else /* defined(__v850e__) */
2319 /* (Ahi << 32 + Alo) * (Bhi << 32 + Blo) */
2322 mulu r7, r8, r0 /* Ahi * Blo */
2323 mulu r6, r9, r0 /* Alo * Bhi */
2324 mulu r6, r10, r11 /* Alo * Blo */
2328 #endif /* defined(__v850e__) */
2329 .size ___muldi3, . - ___muldi3