1 /* libgcc routines for NEC V850.
2 Copyright
(C
) 1996, 1997, 2002 Free Software Foundation
, Inc.
4 This file is part of GNU CC.
6 GNU CC 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
, 59 Temple Place
- Suite
330,
28 Boston
, MA
02111-1307, 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 */
287 .size __save_r2_r29,.-__save_r2_r29
289 /* Restore saved registers, deallocate stack and return to the user */
290 /* Called via: jr __return_r2_r29 */
292 .globl __return_r2_r29
293 .type __return_r2_r29,@function
311 .size __return_r2_r29,.-__return_r2_r29
312 #endif /* L_save_2 */
317 .globl __save_r20_r29
318 .type __save_r20_r29,@function
319 /* Allocate space and save registers 20 .. 29 on the stack */
320 /* Called via: jalr __save_r20_r29,r10 */
337 .size __save_r20_r29,.-__save_r20_r29
339 /* Restore saved registers, deallocate stack and return to the user */
340 /* Called via: jr __return_r20_r29 */
342 .globl __return_r20_r29
343 .type __return_r20_r29,@function
360 .size __return_r20_r29,.-__return_r20_r29
361 #endif /* L_save_20 */
366 .globl __save_r21_r29
367 .type __save_r21_r29,@function
368 /* Allocate space and save registers 21 .. 29 on the stack */
369 /* Called via: jalr __save_r21_r29,r10 */
385 .size __save_r21_r29,.-__save_r21_r29
387 /* Restore saved registers, deallocate stack and return to the user */
388 /* Called via: jr __return_r21_r29 */
390 .globl __return_r21_r29
391 .type __return_r21_r29,@function
407 .size __return_r21_r29,.-__return_r21_r29
408 #endif /* L_save_21 */
413 .globl __save_r22_r29
414 .type __save_r22_r29,@function
415 /* Allocate space and save registers 22 .. 29 on the stack */
416 /* Called via: jalr __save_r22_r29,r10 */
431 .size __save_r22_r29,.-__save_r22_r29
433 /* Restore saved registers, deallocate stack and return to the user */
434 /* Called via: jr __return_r22_r29 */
436 .globl __return_r22_r29
437 .type __return_r22_r29,@function
452 .size __return_r22_r29,.-__return_r22_r29
453 #endif /* L_save_22 */
458 .globl __save_r23_r29
459 .type __save_r23_r29,@function
460 /* Allocate space and save registers 23 .. 29 on the stack */
461 /* Called via: jalr __save_r23_r29,r10 */
475 .size __save_r23_r29,.-__save_r23_r29
477 /* Restore saved registers, deallocate stack and return to the user */
478 /* Called via: jr __return_r23_r29 */
480 .globl __return_r23_r29
481 .type __return_r23_r29,@function
495 .size __return_r23_r29,.-__return_r23_r29
496 #endif /* L_save_23 */
501 .globl __save_r24_r29
502 .type __save_r24_r29,@function
503 /* Allocate space and save registers 24 .. 29 on the stack */
504 /* Called via: jalr __save_r24_r29,r10 */
517 .size __save_r24_r29,.-__save_r24_r29
519 /* Restore saved registers, deallocate stack and return to the user */
520 /* Called via: jr __return_r24_r29 */
522 .globl __return_r24_r29
523 .type __return_r24_r29,@function
536 .size __return_r24_r29,.-__return_r24_r29
537 #endif /* L_save_24 */
542 .globl __save_r25_r29
543 .type __save_r25_r29,@function
544 /* Allocate space and save registers 25 .. 29 on the stack */
545 /* Called via: jalr __save_r25_r29,r10 */
557 .size __save_r25_r29,.-__save_r25_r29
559 /* Restore saved registers, deallocate stack and return to the user */
560 /* Called via: jr __return_r25_r29 */
562 .globl __return_r25_r29
563 .type __return_r25_r29,@function
575 .size __return_r25_r29,.-__return_r25_r29
576 #endif /* L_save_25 */
581 .globl __save_r26_r29
582 .type __save_r26_r29,@function
583 /* Allocate space and save registers 26 .. 29 on the stack */
584 /* Called via: jalr __save_r26_r29,r10 */
595 .size __save_r26_r29,.-__save_r26_r29
597 /* Restore saved registers, deallocate stack and return to the user */
598 /* Called via: jr __return_r26_r29 */
600 .globl __return_r26_r29
601 .type __return_r26_r29,@function
612 .size __return_r26_r29,.-__return_r26_r29
613 #endif /* L_save_26 */
618 .globl __save_r27_r29
619 .type __save_r27_r29,@function
620 /* Allocate space and save registers 27 .. 29 on the stack */
621 /* Called via: jalr __save_r27_r29,r10 */
628 .size __save_r27_r29,.-__save_r27_r29
630 /* Restore saved registers, deallocate stack and return to the user */
631 /* Called via: jr __return_r27_r29 */
633 .globl __return_r27_r29
634 .type __return_r27_r29,@function
641 .size __return_r27_r29,.-__return_r27_r29
642 #endif /* L_save_27 */
647 .globl __save_r28_r29
648 .type __save_r28_r29,@function
649 /* Allocate space and save registers 28,29 on the stack */
650 /* Called via: jalr __save_r28_r29,r10 */
656 .size __save_r28_r29,.-__save_r28_r29
658 /* Restore saved registers, deallocate stack and return to the user */
659 /* Called via: jr __return_r28_r29 */
661 .globl __return_r28_r29
662 .type __return_r28_r29,@function
668 .size __return_r28_r29,.-__return_r28_r29
669 #endif /* L_save_28 */
675 .type __save_r29,@function
676 /* Allocate space and save register 29 on the stack */
677 /* Called via: jalr __save_r29,r10 */
682 .size __save_r29,.-__save_r29
684 /* Restore saved register 29, deallocate stack and return to the user */
685 /* Called via: jr __return_r29 */
688 .type __return_r29,@function
693 .size __return_r29,.-__return_r29
694 #endif /* L_save_28 */
700 .type __save_r2_r31,@function
701 /* Allocate space and save registers 20 .. 29, 31 on the stack */
702 /* Also allocate space for the argument save area */
703 /* Called via: jalr __save_r2_r31,r10 */
722 .size __save_r2_r31,.-__save_r2_r31
724 /* Restore saved registers, deallocate stack and return to the user */
725 /* Called via: jr __return_r20_r31 */
727 .globl __return_r2_r31
728 .type __return_r2_r31,@function
747 .size __return_r2_r31,.-__return_r2_r31
748 #endif /* L_save_2c */
753 .globl __save_r20_r31
754 .type __save_r20_r31,@function
755 /* Allocate space and save registers 20 .. 29, 31 on the stack */
756 /* Also allocate space for the argument save area */
757 /* Called via: jalr __save_r20_r31,r10 */
775 .size __save_r20_r31,.-__save_r20_r31
777 /* Restore saved registers, deallocate stack and return to the user */
778 /* Called via: jr __return_r20_r31 */
780 .globl __return_r20_r31
781 .type __return_r20_r31,@function
799 .size __return_r20_r31,.-__return_r20_r31
800 #endif /* L_save_20c */
805 .globl __save_r21_r31
806 .type __save_r21_r31,@function
807 /* Allocate space and save registers 21 .. 29, 31 on the stack */
808 /* Also allocate space for the argument save area */
809 /* Called via: jalr __save_r21_r31,r10 */
826 .size __save_r21_r31,.-__save_r21_r31
828 /* Restore saved registers, deallocate stack and return to the user */
829 /* Called via: jr __return_r21_r31 */
831 .globl __return_r21_r31
832 .type __return_r21_r31,@function
849 .size __return_r21_r31,.-__return_r21_r31
850 #endif /* L_save_21c */
855 .globl __save_r22_r31
856 .type __save_r22_r31,@function
857 /* Allocate space and save registers 22 .. 29, 31 on the stack */
858 /* Also allocate space for the argument save area */
859 /* Called via: jalr __save_r22_r31,r10 */
875 .size __save_r22_r31,.-__save_r22_r31
877 /* Restore saved registers, deallocate stack and return to the user */
878 /* Called via: jr __return_r22_r31 */
880 .globl __return_r22_r31
881 .type __return_r22_r31,@function
897 .size __return_r22_r31,.-__return_r22_r31
898 #endif /* L_save_22c */
903 .globl __save_r23_r31
904 .type __save_r23_r31,@function
905 /* Allocate space and save registers 23 .. 29, 31 on the stack */
906 /* Also allocate space for the argument save area */
907 /* Called via: jalr __save_r23_r31,r10 */
922 .size __save_r23_r31,.-__save_r23_r31
924 /* Restore saved registers, deallocate stack and return to the user */
925 /* Called via: jr __return_r23_r31 */
927 .globl __return_r23_r31
928 .type __return_r23_r31,@function
943 .size __return_r23_r31,.-__return_r23_r31
944 #endif /* L_save_23c */
949 .globl __save_r24_r31
950 .type __save_r24_r31,@function
951 /* Allocate space and save registers 24 .. 29, 31 on the stack */
952 /* Also allocate space for the argument save area */
953 /* Called via: jalr __save_r24_r31,r10 */
967 .size __save_r24_r31,.-__save_r24_r31
969 /* Restore saved registers, deallocate stack and return to the user */
970 /* Called via: jr __return_r24_r31 */
972 .globl __return_r24_r31
973 .type __return_r24_r31,@function
987 .size __return_r24_r31,.-__return_r24_r31
988 #endif /* L_save_24c */
993 .globl __save_r25_r31
994 .type __save_r25_r31,@function
995 /* Allocate space and save registers 25 .. 29, 31 on the stack */
996 /* Also allocate space for the argument save area */
997 /* Called via: jalr __save_r25_r31,r10 */
1010 .size __save_r25_r31,.-__save_r25_r31
1012 /* Restore saved registers, deallocate stack and return to the user */
1013 /* Called via: jr __return_r25_r31 */
1015 .globl __return_r25_r31
1016 .type __return_r25_r31,@function
1029 .size __return_r25_r31,.-__return_r25_r31
1030 #endif /* L_save_25c */
1035 .globl __save_r26_r31
1036 .type __save_r26_r31,@function
1037 /* Allocate space and save registers 26 .. 29, 31 on the stack */
1038 /* Also allocate space for the argument save area */
1039 /* Called via: jalr __save_r26_r31,r10 */
1051 .size __save_r26_r31,.-__save_r26_r31
1053 /* Restore saved registers, deallocate stack and return to the user */
1054 /* Called via: jr __return_r26_r31 */
1056 .globl __return_r26_r31
1057 .type __return_r26_r31,@function
1069 .size __return_r26_r31,.-__return_r26_r31
1070 #endif /* L_save_26c */
1075 .globl __save_r27_r31
1076 .type __save_r27_r31,@function
1077 /* Allocate space and save registers 27 .. 29, 31 on the stack */
1078 /* Also allocate space for the argument save area */
1079 /* Called via: jalr __save_r27_r31,r10 */
1090 .size __save_r27_r31,.-__save_r27_r31
1092 /* Restore saved registers, deallocate stack and return to the user */
1093 /* Called via: jr __return_r27_r31 */
1095 .globl __return_r27_r31
1096 .type __return_r27_r31,@function
1107 .size __return_r27_r31,.-__return_r27_r31
1108 #endif /* L_save_27c */
1113 .globl __save_r28_r31
1114 .type __save_r28_r31,@function
1115 /* Allocate space and save registers 28 .. 29, 31 on the stack */
1116 /* Also allocate space for the argument save area */
1117 /* Called via: jalr __save_r28_r31,r10 */
1124 .size __save_r28_r31,.-__save_r28_r31
1126 /* Restore saved registers, deallocate stack and return to the user */
1127 /* Called via: jr __return_r28_r31 */
1129 .globl __return_r28_r31
1130 .type __return_r28_r31,@function
1137 .size __return_r28_r31,.-__return_r28_r31
1138 #endif /* L_save_28c */
1143 .globl __save_r29_r31
1144 .type __save_r29_r31,@function
1145 /* Allocate space and save registers 29 & 31 on the stack */
1146 /* Also allocate space for the argument save area */
1147 /* Called via: jalr __save_r29_r31,r10 */
1153 .size __save_r29_r31,.-__save_r29_r31
1155 /* Restore saved registers, deallocate stack and return to the user */
1156 /* Called via: jr __return_r29_r31 */
1158 .globl __return_r29_r31
1159 .type __return_r29_r31,@function
1165 .size __return_r29_r31,.-__return_r29_r31
1166 #endif /* L_save_29c */
1172 .type __save_r31,@function
1173 /* Allocate space and save register 31 on the stack */
1174 /* Also allocate space for the argument save area */
1175 /* Called via: jalr __save_r31,r10 */
1180 .size __save_r31,.-__save_r31
1182 /* Restore saved registers, deallocate stack and return to the user */
1183 /* Called via: jr __return_r31 */
1186 .type __return_r31,@function
1191 .size __return_r31,.-__return_r31
1192 #endif /* L_save_31c */
1194 #ifdef L_save_varargs
1198 .type __save_r6_r9,@function
1199 /* Save registers 6 .. 9 on the stack for variable argument functions */
1200 /* Called via: jalr __save_r6_r9,r10 */
1210 .size __save_r6_r9,.-__save_r6_r9
1211 #endif /* L_save_varargs */
1213 #ifdef L_save_interrupt
1216 .globl __save_interrupt
1217 .type __save_interrupt,@function
1218 /* Save registers r1, r4 on stack and load up with expected values */
1219 /* Note, 12 bytes of stack have already been allocated. */
1220 /* Called via: jalr __save_interrupt,r10 */
1225 movhi hi(__ep),r0,ep
1226 movea lo(__ep),ep,ep
1227 movhi hi(__gp),r0,gp
1228 movea lo(__gp),gp,gp
1230 .size __save_interrupt,.-__save_interrupt
1232 /* Restore saved registers, deallocate stack and return from the interrupt */
1233 /* Called via: jr __return_interrupt */
1235 .globl __return_interrupt
1236 .type __return_interrupt,@function
1244 .size __return_interrupt,.-__return_interrupt
1245 #endif /* L_save_interrupt */
1247 #ifdef L_save_all_interrupt
1250 .globl __save_all_interrupt
1251 .type __save_all_interrupt,@function
1252 /* Save all registers except for those saved in __save_interrupt */
1253 /* allocate enough stack for all of the registers & 16 bytes of space */
1254 /* Called via: jalr __save_all_interrupt,r10 */
1255 __save_all_interrupt:
1287 .size __save_all_interrupt,.-__save_all_interrupt
1289 .globl __restore_all_interrupt
1290 .type __restore_all_interrupt,@function
1291 /* Restore all registers saved in __save_all_interrupt */
1292 /* & deallocate the stack space */
1293 /* Called via: jalr __restore_all_interrupt,r10 */
1294 __restore_all_interrupt:
1326 .size __restore_all_interrupt,.-__restore_all_interrupt
1327 #endif /* L_save_all_interrupt */
1330 #if defined __v850e__
1331 #ifdef L_callt_save_r2_r29
1332 /* Put these functions into the call table area. */
1335 /* Allocate space and save registers 2, 20 .. 29 on the stack. */
1336 /* Called via: callt ctoff(__callt_save_r2_r29). */
1341 prepare {r20 - r29}, 0
1344 /* Restore saved registers, deallocate stack and return to the user. */
1345 /* Called via: callt ctoff(__callt_return_r2_r29). */
1348 dispose 0, {r20-r29}
1353 /* Place the offsets of the start of these routines into the call table. */
1356 .global __callt_save_r2_r29
1357 .type __callt_save_r2_r29,@function
1358 __callt_save_r2_r29: .short ctoff(.L_save_r2_r29)
1360 .global __callt_return_r2_r29
1361 .type __callt_return_r2_r29,@function
1362 __callt_return_r2_r29: .short ctoff(.L_return_r2_r29)
1364 #endif /* L_callt_save_r2_r29 */
1366 #ifdef L_callt_save_r2_r31
1367 /* Put these functions into the call table area. */
1370 /* Allocate space and save registers 2 and 20 .. 29, 31 on the stack. */
1371 /* Also allocate space for the argument save area. */
1372 /* Called via: callt ctoff(__callt_save_r2_r31). */
1377 prepare {r20 - r29, r31}, 4
1380 /* Restore saved registers, deallocate stack and return to the user. */
1381 /* Called via: callt ctoff(__callt_return_r2_r31). */
1384 dispose 4, {r20 - r29, r31}
1389 /* Place the offsets of the start of these routines into the call table. */
1392 .global __callt_save_r2_r31
1393 .type __callt_save_r2_r31,@function
1394 __callt_save_r2_r31: .short ctoff(.L_save_r2_r31)
1396 .global __callt_return_r2_r31
1397 .type __callt_return_r2_r31,@function
1398 __callt_return_r2_r31: .short ctoff(.L_return_r2_r31)
1400 #endif /* L_callt_save_r2_r31 */
1403 #ifdef L_callt_save_r6_r9
1404 /* Put these functions into the call table area. */
1407 /* Save registers r6 - r9 onto the stack in the space reserved for them.
1408 Use by variable argument functions.
1409 Called via: callt ctoff(__callt_save_r6_r9). */
1421 /* Place the offsets of the start of this routines into the call table. */
1424 .global __callt_save_r6_r9
1425 .type __callt_save_r6_r9,@function
1426 __callt_save_r6_r9: .short ctoff(.L_save_r6_r9)
1427 #endif /* L_callt_save_r6_r9 */
1430 #ifdef L_callt_save_interrupt
1431 /* Put this functions into the call table area */
1434 /* Save registers r1, ep, gp, r10 on stack and load up with expected values. */
1435 /* Called via: callt ctoff(__callt_save_interrupt). */
1438 /* SP has already been moved before callt ctoff(_save_interrupt). */
1439 /* addi -24, sp, sp */
1443 /* R10 has alread been saved bofore callt ctoff(_save_interrupt). */
1444 /* st.w r10, 12[sp] */
1449 /* Place the offsets of the start of the routine into the call table. */
1451 .global __callt_save_interrupt
1452 .type __callt_save_interrupt,@function
1453 __callt_save_interrupt: .short ctoff(.L_save_interrupt)
1457 /* Restore saved registers, deallocate stack and return from the interrupt. */
1458 /* Called via: callt ctoff(__callt_restore_itnerrupt). */
1461 .globl __return_interrupt
1462 .type __return_interrupt,@function
1463 .L_return_interrupt:
1475 /* Place the offsets of the start of the routine into the call table. */
1478 .global __callt_return_interrupt
1479 .type __callt_return_interrupt,@function
1480 __callt_return_interrupt: .short ctoff(.L_return_interrupt)
1482 #endif /* L_callt_save_interrupt */
1484 #ifdef L_callt_save_all_interrupt
1485 /* Put this functions into the call table area. */
1488 /* Save all registers except for those saved in __save_interrupt. */
1489 /* Allocate enough stack for all of the registers & 16 bytes of space. */
1490 /* Called via: callt ctoff(__callt_save_all_interrupt). */
1492 .L_save_all_interrupt:
1513 prepare {r20 - r29, r31}, 4
1516 /* Restore all registers saved in __save_all_interrupt. */
1517 /* & deallocate the stack space. */
1518 /* Called via: callt ctoff(__callt_restore_all_interrupt). */
1520 .L_restore_all_interrupt:
1521 dispose 4, {r20 - r29, r31}
1544 /* Place the offsets of the start of these routines into the call table. */
1547 .global __callt_save_all_interrupt
1548 .type __callt_save_all_interrupt,@function
1549 __callt_save_all_interrupt: .short ctoff(.L_save_all_interrupt)
1551 .global __callt_restore_all_interrupt
1552 .type __callt_restore_all_interrupt,@function
1553 __callt_restore_all_interrupt: .short ctoff(.L_restore_all_interrupt)
1555 #endif /* L_callt_save_all_interrupt */
1558 #define MAKE_CALLT_FUNCS( START ) \
1561 /* Allocate space and save registers START .. r29 on the stack. */ ;\
1562 /* Called via: callt ctoff(__callt_save_START_r29). */ ;\
1563 .L_save_##START##_r29: ;\
1564 prepare { START - r29 }, 0 ;\
1567 /* Restore saved registers, deallocate stack and return. */ ;\
1568 /* Called via: callt ctoff(__return_START_r29) */ ;\
1570 .L_return_##START##_r29: ;\
1571 dispose 0, { START - r29 }, r31 ;\
1573 /* Place the offsets of the start of these funcs into the call table. */;\
1576 .global __callt_save_##START##_r29 ;\
1577 .type __callt_save_##START##_r29,@function ;\
1578 __callt_save_##START##_r29: .short ctoff(.L_save_##START##_r29 ) ;\
1580 .global __callt_return_##START##_r29 ;\
1581 .type __callt_return_##START##_r29,@function ;\
1582 __callt_return_##START##_r29: .short ctoff(.L_return_##START##_r29 )
1585 #define MAKE_CALLT_CFUNCS( START ) \
1588 /* Allocate space and save registers START .. r31 on the stack. */ ;\
1589 /* Called via: callt ctoff(__callt_save_START_r31c). */ ;\
1590 .L_save_##START##_r31c: ;\
1591 prepare { START - r29, r31}, 4 ;\
1594 /* Restore saved registers, deallocate stack and return. */ ;\
1595 /* Called via: callt ctoff(__return_START_r31c). */ ;\
1597 .L_return_##START##_r31c: ;\
1598 dispose 4, { START - r29, r31}, r31 ;\
1600 /* Place the offsets of the start of these funcs into the call table. */;\
1603 .global __callt_save_##START##_r31c ;\
1604 .type __callt_save_##START##_r31c,@function ;\
1605 __callt_save_##START##_r31c: .short ctoff(.L_save_##START##_r31c ) ;\
1607 .global __callt_return_##START##_r31c ;\
1608 .type __callt_return_##START##_r31c,@function ;\
1609 __callt_return_##START##_r31c: .short ctoff(.L_return_##START##_r31c )
1612 #ifdef L_callt_save_20
1613 MAKE_CALLT_FUNCS (r20)
1615 #ifdef L_callt_save_21
1616 MAKE_CALLT_FUNCS (r21)
1618 #ifdef L_callt_save_22
1619 MAKE_CALLT_FUNCS (r22)
1621 #ifdef L_callt_save_23
1622 MAKE_CALLT_FUNCS (r23)
1624 #ifdef L_callt_save_24
1625 MAKE_CALLT_FUNCS (r24)
1627 #ifdef L_callt_save_25
1628 MAKE_CALLT_FUNCS (r25)
1630 #ifdef L_callt_save_26
1631 MAKE_CALLT_FUNCS (r26)
1633 #ifdef L_callt_save_27
1634 MAKE_CALLT_FUNCS (r27)
1636 #ifdef L_callt_save_28
1637 MAKE_CALLT_FUNCS (r28)
1639 #ifdef L_callt_save_29
1640 MAKE_CALLT_FUNCS (r29)
1643 #ifdef L_callt_save_20c
1644 MAKE_CALLT_CFUNCS (r20)
1646 #ifdef L_callt_save_21c
1647 MAKE_CALLT_CFUNCS (r21)
1649 #ifdef L_callt_save_22c
1650 MAKE_CALLT_CFUNCS (r22)
1652 #ifdef L_callt_save_23c
1653 MAKE_CALLT_CFUNCS (r23)
1655 #ifdef L_callt_save_24c
1656 MAKE_CALLT_CFUNCS (r24)
1658 #ifdef L_callt_save_25c
1659 MAKE_CALLT_CFUNCS (r25)
1661 #ifdef L_callt_save_26c
1662 MAKE_CALLT_CFUNCS (r26)
1664 #ifdef L_callt_save_27c
1665 MAKE_CALLT_CFUNCS (r27)
1667 #ifdef L_callt_save_28c
1668 MAKE_CALLT_CFUNCS (r28)
1670 #ifdef L_callt_save_29c
1671 MAKE_CALLT_CFUNCS (r29)
1675 #ifdef L_callt_save_31c
1678 /* Allocate space and save register r31 on the stack. */
1679 /* Called via: callt ctoff(__callt_save_r31c). */
1684 /* Restore saved registers, deallocate stack and return. */
1685 /* Called via: callt ctoff(__return_r31c). */
1687 .L_callt_return_r31c:
1688 dispose 4, {r31}, r31
1690 /* Place the offsets of the start of these funcs into the call table. */
1693 .global __callt_save_r31c
1694 .type __callt_save_r31c,@function
1695 __callt_save_r31c: .short ctoff(.L_callt_save_r31c)
1697 .global __callt_return_r31c
1698 .type __callt_return_r31c,@function
1699 __callt_return_r31c: .short ctoff(.L_callt_return_r31c)
1702 #endif /* __v850e__ */
1704 /* libgcc2 routines for NEC V850. */
1705 /* Double Integer Arithmetical Operation. */
1710 .type ___negdi2, @function
1719 .size ___negdi2,.-___negdi2
1725 .type ___cmpdi2,@function
1727 # Signed comparison bitween each high word.
1735 # Unsigned comparigon bitween each low word.
1741 .size ___cmpdi2, . - ___cmpdi2
1747 .type ___ucmpdi2,@function
1749 cmp r9, r7 # Check if each high word are same.
1750 be .L_ucmpdi_check_psw
1751 cmp r8, r6 # Compare the word.
1752 .L_ucmpdi_check_psw:
1755 add r6, r10 # Add the result of comparison NL and comparison H.
1757 .size ___ucmpdi2, . - ___ucmpdi2
1763 .type ___muldi3,@function
1766 jarl __save_r26_r31, r10
1770 movea lo(32767), r0, r14
1847 movhi hi(131071), r0, r12
1848 movea lo(131071), r12, r13
1871 #endif /* __v850__ */
1872 #if defined(__v850e__) || defined(__v850ea__)
1873 /* (Ahi << 32 + Alo) * (Bhi << 32 + Blo) */
1876 mulu r7, r8, r0 /* Ahi * Blo */
1877 mulu r6, r9, r0 /* Alo * Bhi */
1878 mulu r6, r10, r11 /* Alo * Blo */
1883 #endif /* defined(__v850e__) || defined(__v850ea__) */
1884 .size ___muldi3, . - ___muldi3