OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [config/] [fr30/] [lib1funcs.asm] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
/* libgcc routines for the FR30.
2
   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
3
 
4
This file is part of GCC.
5
 
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
9
later version.
10
 
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
18
executable.)
19
 
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.
24
 
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.  */
29
 
30
        .macro FUNC_START name
31
        .text
32
        .globl __\name
33
        .type  __\name, @function
34
__\name:
35
        .endm
36
 
37
        .macro FUNC_END name
38
        .size  __\name, . - __\name
39
        .endm
40
 
41
        .macro DIV_BODY reg number
42
        .if \number
43
        DIV_BODY  \reg, "\number - 1"
44
        div1    \reg
45
        .endif
46
        .endm
47
 
48
#ifdef L_udivsi3
49
FUNC_START udivsi3
50
        ;; Perform an unsiged division of r4 / r5 and place the result in r4.
51
        ;; Does not handle overflow yet...
52
        mov     r4, mdl
53
        div0u   r5
54
        DIV_BODY r5 32
55
        mov     mdl, r4
56
        ret
57
FUNC_END udivsi3
58
#endif /* L_udivsi3 */
59
 
60
#ifdef L_divsi3
61
FUNC_START divsi3
62
        ;; Perform a siged division of r4 / r5 and place the result in r4.
63
        ;; Does not handle overflow yet...
64
        mov     r4, mdl
65
        div0s   r5
66
        DIV_BODY r5 32
67
        div2    r5
68
        div3
69
        div4s
70
        mov     mdl, r4
71
        ret
72
FUNC_END divsi3
73
#endif /* L_divsi3 */
74
 
75
#ifdef L_umodsi3
76
FUNC_START umodsi3
77
        ;; Perform an unsiged division of r4 / r5 and places the remainder in r4.
78
        ;; Does not handle overflow yet...
79
        mov     r4, mdl
80
        div0u   r5
81
        DIV_BODY r5 32
82
        mov     mdh, r4
83
        ret
84
FUNC_END umodsi3
85
#endif /* L_umodsi3 */
86
 
87
#ifdef L_modsi3
88
FUNC_START modsi3
89
        ;; Perform a siged division of r4 / r5 and place the remainder in r4.
90
        ;; Does not handle overflow yet...
91
        mov     r4, mdl
92
        div0s   r5
93
        DIV_BODY r5 32
94
        div2    r5
95
        div3
96
        div4s
97
        mov     mdh, r4
98
        ret
99
FUNC_END modsi3
100
#endif /* L_modsi3 */
101
 
102
#ifdef L_negsi2
103
FUNC_START negsi2
104
        ldi:8   #0, r0
105
        sub     r4, r0
106
        mov     r0, r4
107
        ret
108
FUNC_END negsi2
109
#endif /* L_negsi2 */
110
 
111
#ifdef L_one_cmplsi2
112
FUNC_START one_cmplsi2
113
        ldi:8   #0xff, r0
114
        extsb   r0
115
        eor     r0, r4
116
        ret
117
FUNC_END one_cmplsi2
118
#endif /* L_one_cmplsi2 */
119
 
120
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.