1 /* libgcc routines for NEC V850.
2 Copyright
(C
) 1996, 1997, 2002 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 */
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 and
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 these 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 already been saved before callt ctoff(_save_interrupt). */
1444 /* st.w r10, 12[sp] */
1449 /* Restore saved registers, deallocate stack and return from the interrupt. */
1450 /* Called via: callt ctoff(__callt_restore_interrupt). */
1452 .globl __return_interrupt
1453 .type __return_interrupt,@function
1454 .L_return_interrupt:
1466 /* Place the offsets of the start of these routines into the call table. */
1469 .global __callt_save_interrupt
1470 .type __callt_save_interrupt,@function
1471 __callt_save_interrupt: .short ctoff(.L_save_interrupt)
1473 .global __callt_return_interrupt
1474 .type __callt_return_interrupt,@function
1475 __callt_return_interrupt: .short ctoff(.L_return_interrupt)
1477 #endif /* L_callt_save_interrupt */
1479 #ifdef L_callt_save_all_interrupt
1480 /* Put these functions into the call table area. */
1483 /* Save all registers except for those saved in __save_interrupt. */
1484 /* Allocate enough stack for all of the registers & 16 bytes of space. */
1485 /* Called via: callt ctoff(__callt_save_all_interrupt). */
1487 .L_save_all_interrupt:
1508 prepare {r20 - r29, r31}, 4
1511 /* Restore all registers saved in __save_all_interrupt
1512 deallocate the stack space. */
1513 /* Called via: callt ctoff(__callt_restore_all_interrupt). */
1515 .L_restore_all_interrupt:
1516 dispose 4, {r20 - r29, r31}
1539 /* Place the offsets of the start of these routines into the call table. */
1542 .global __callt_save_all_interrupt
1543 .type __callt_save_all_interrupt,@function
1544 __callt_save_all_interrupt: .short ctoff(.L_save_all_interrupt)
1546 .global __callt_restore_all_interrupt
1547 .type __callt_restore_all_interrupt,@function
1548 __callt_restore_all_interrupt: .short ctoff(.L_restore_all_interrupt)
1550 #endif /* L_callt_save_all_interrupt */
1553 #define MAKE_CALLT_FUNCS( START ) \
1556 /* Allocate space and save registers START .. r29 on the stack. */ ;\
1557 /* Called via: callt ctoff(__callt_save_START_r29). */ ;\
1558 .L_save_##START##_r29: ;\
1559 prepare { START - r29 }, 0 ;\
1562 /* Restore saved registers, deallocate stack and return. */ ;\
1563 /* Called via: callt ctoff(__return_START_r29) */ ;\
1565 .L_return_##START##_r29: ;\
1566 dispose 0, { START - r29 }, r31 ;\
1568 /* Place the offsets of the start of these funcs into the call table. */;\
1571 .global __callt_save_##START##_r29 ;\
1572 .type __callt_save_##START##_r29,@function ;\
1573 __callt_save_##START##_r29: .short ctoff(.L_save_##START##_r29 ) ;\
1575 .global __callt_return_##START##_r29 ;\
1576 .type __callt_return_##START##_r29,@function ;\
1577 __callt_return_##START##_r29: .short ctoff(.L_return_##START##_r29 )
1580 #define MAKE_CALLT_CFUNCS( START ) \
1583 /* Allocate space and save registers START .. r31 on the stack. */ ;\
1584 /* Called via: callt ctoff(__callt_save_START_r31c). */ ;\
1585 .L_save_##START##_r31c: ;\
1586 prepare { START - r29, r31}, 4 ;\
1589 /* Restore saved registers, deallocate stack and return. */ ;\
1590 /* Called via: callt ctoff(__return_START_r31c). */ ;\
1592 .L_return_##START##_r31c: ;\
1593 dispose 4, { START - r29, r31}, r31 ;\
1595 /* Place the offsets of the start of these funcs into the call table. */;\
1598 .global __callt_save_##START##_r31c ;\
1599 .type __callt_save_##START##_r31c,@function ;\
1600 __callt_save_##START##_r31c: .short ctoff(.L_save_##START##_r31c ) ;\
1602 .global __callt_return_##START##_r31c ;\
1603 .type __callt_return_##START##_r31c,@function ;\
1604 __callt_return_##START##_r31c: .short ctoff(.L_return_##START##_r31c )
1607 #ifdef L_callt_save_20
1608 MAKE_CALLT_FUNCS (r20)
1610 #ifdef L_callt_save_21
1611 MAKE_CALLT_FUNCS (r21)
1613 #ifdef L_callt_save_22
1614 MAKE_CALLT_FUNCS (r22)
1616 #ifdef L_callt_save_23
1617 MAKE_CALLT_FUNCS (r23)
1619 #ifdef L_callt_save_24
1620 MAKE_CALLT_FUNCS (r24)
1622 #ifdef L_callt_save_25
1623 MAKE_CALLT_FUNCS (r25)
1625 #ifdef L_callt_save_26
1626 MAKE_CALLT_FUNCS (r26)
1628 #ifdef L_callt_save_27
1629 MAKE_CALLT_FUNCS (r27)
1631 #ifdef L_callt_save_28
1632 MAKE_CALLT_FUNCS (r28)
1634 #ifdef L_callt_save_29
1635 MAKE_CALLT_FUNCS (r29)
1638 #ifdef L_callt_save_20c
1639 MAKE_CALLT_CFUNCS (r20)
1641 #ifdef L_callt_save_21c
1642 MAKE_CALLT_CFUNCS (r21)
1644 #ifdef L_callt_save_22c
1645 MAKE_CALLT_CFUNCS (r22)
1647 #ifdef L_callt_save_23c
1648 MAKE_CALLT_CFUNCS (r23)
1650 #ifdef L_callt_save_24c
1651 MAKE_CALLT_CFUNCS (r24)
1653 #ifdef L_callt_save_25c
1654 MAKE_CALLT_CFUNCS (r25)
1656 #ifdef L_callt_save_26c
1657 MAKE_CALLT_CFUNCS (r26)
1659 #ifdef L_callt_save_27c
1660 MAKE_CALLT_CFUNCS (r27)
1662 #ifdef L_callt_save_28c
1663 MAKE_CALLT_CFUNCS (r28)
1665 #ifdef L_callt_save_29c
1666 MAKE_CALLT_CFUNCS (r29)
1670 #ifdef L_callt_save_31c
1673 /* Allocate space and save register r31 on the stack. */
1674 /* Called via: callt ctoff(__callt_save_r31c). */
1679 /* Restore saved registers, deallocate stack and return. */
1680 /* Called via: callt ctoff(__return_r31c). */
1682 .L_callt_return_r31c:
1683 dispose 4, {r31}, r31
1685 /* Place the offsets of the start of these funcs into the call table. */
1688 .global __callt_save_r31c
1689 .type __callt_save_r31c,@function
1690 __callt_save_r31c: .short ctoff(.L_callt_save_r31c)
1692 .global __callt_return_r31c
1693 .type __callt_return_r31c,@function
1694 __callt_return_r31c: .short ctoff(.L_callt_return_r31c)
1697 #endif /* __v850e__ */
1699 /* libgcc2 routines for NEC V850. */
1700 /* Double Integer Arithmetical Operation. */
1705 .type ___negdi2, @function
1714 .size ___negdi2,.-___negdi2
1720 .type ___cmpdi2,@function
1722 # Signed comparison bitween each high word.
1730 # Unsigned comparigon bitween each low word.
1736 .size ___cmpdi2, . - ___cmpdi2
1742 .type ___ucmpdi2,@function
1744 cmp r9, r7 # Check if each high word are same.
1745 be .L_ucmpdi_check_psw
1746 cmp r8, r6 # Compare the word.
1747 .L_ucmpdi_check_psw:
1750 add r6, r10 # Add the result of comparison NL and comparison H.
1752 .size ___ucmpdi2, . - ___ucmpdi2
1758 .type ___muldi3,@function
1761 jarl __save_r26_r31, r10
1765 movea lo(32767), r0, r14
1842 movhi hi(131071), r0, r12
1843 movea lo(131071), r12, r13
1866 #endif /* __v850__ */
1867 #if defined(__v850e__) || defined(__v850ea__)
1868 /* (Ahi << 32 + Alo) * (Bhi << 32 + Blo) */
1871 mulu r7, r8, r0 /* Ahi * Blo */
1872 mulu r6, r9, r0 /* Alo * Bhi */
1873 mulu r6, r10, r11 /* Alo * Blo */
1878 #endif /* defined(__v850e__) || defined(__v850ea__) */
1879 .size ___muldi3, . - ___muldi3