2 Copyright
(C
) 2000, 2003 Free Software Foundation
, Inc.
3 Contributed by Red Hat
, Inc.
5 This file is part of GCC.
7 GCC is free software
; you can redistribute it and/or modify
8 it under the terms of the GNU General
Public License as published by
9 the Free Software Foundation
* either version
2, or (at your option
)
12 GCC is distributed
in the hope that it will be useful
,
13 but WITHOUT ANY WARRANTY
; without even the implied warranty of
14 MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General
Public License for more details.
17 You should have received a copy of the GNU General
Public License
18 along with GCC
; see the file COPYING. If not, write to
19 the Free Software Foundation
, 51 Franklin Street
, Fifth Floor
,
20 Boston
, MA
02110-1301, USA.
*/
22 /* As a special exception
, if you link
this library with other files
,
23 some of which are compiled with GCC
, to produce an executable
,
24 this library does
not by itself cause the resulting executable
25 to be covered by the GNU General
Public License.
26 This exception does
not however invalidate any other reasons why
27 the executable file might be covered by the GNU General
Public License.
*/
33 /* icc0
= __cmpll
(long long a
, long long b
) */
37 .
type EXT
(__cmpll
),@function
43 P
(ccmp
) gr9
, gr11
, cc4
, 1
46 .
size EXT
(__cmpll
),.Lend
-EXT
(__cmpll
)
50 /* icc0
= __cmpf
(float a
, float b
) */
51 /* Note
, because
this function returns the result
in ICC0
, it means it can
't
56 .type EXT(__cmpf),@function
60 #ifdef __FRV_HARD_FLOAT__ /* floating point instructions available */
67 csub gr0, gr8, gr8, cc0, 1
71 #else /* no floating point instructions available */
86 .size EXT(__cmpf),.Lend-EXT(__cmpf)
90 /* icc0 = __cmpd (double a, double b) */
91 /* Note, because this function returns the result in ICC0, it means it can't
96 .
type EXT
(__cmpd
),@function
113 .
size EXT
(__cmpd
),.Lend
-EXT
(__cmpd
)
117 /* gr8
,gr9
= __addll
(long long a
, long long b
) */
118 /* Note
, gcc will never
call this function
, but it is present
in case an
119 ABI program calls it.
*/
123 .
type EXT
(__addll
),@function
127 addcc gr9
, gr11
, gr9
, icc0
128 addx gr8
, gr10
, gr8
, icc0
131 .
size EXT
(__addll
),.Lend
-EXT
(__addll
)
135 /* gr8
,gr9
= __subll
(long long a
, long long b
) */
136 /* Note
, gcc will never
call this function
, but it is present
in case an
137 ABI program calls it.
*/
141 .
type EXT
(__subll
),@function
145 subcc gr9
, gr11
, gr9
, icc0
146 subx gr8
, gr10
, gr8
, icc0
149 .
size EXT
(__subll
),.Lend
-EXT
(__subll
)
153 /* gr8
,gr9
= __andll
(long long a
, long long b
) */
154 /* Note
, gcc will never
call this function
, but it is present
in case an
155 ABI program calls it.
*/
159 .
type EXT
(__andll
),@function
163 P
(and) gr9
, gr11
, gr9
164 P2
(and) gr8
, gr10
, gr8
167 .
size EXT
(__andll
),.Lend
-EXT
(__andll
)
171 /* gr8
,gr9
= __orll
(long long a
, long long b
) */
172 /* Note
, gcc will never
call this function
, but it is present
in case an
173 ABI program calls it.
*/
177 .
type EXT
(__orll
),@function
182 P2
(or) gr8
, gr10
, gr8
185 .
size EXT
(__orll
),.Lend
-EXT
(__orll
)
189 /* gr8
,gr9
= __xorll
(long long a
, long long b
) */
190 /* Note
, gcc will never
call this function
, but it is present
in case an
191 ABI program calls it.
*/
195 .
type EXT
(__xorll
),@function
199 P
(xor) gr9
, gr11
, gr9
200 P2
(xor) gr8
, gr10
, gr8
203 .
size EXT
(__xorll
),.Lend
-EXT
(__xorll
)
207 /* gr8
,gr9
= __notll
(long long a
) */
208 /* Note
, gcc will never
call this function
, but it is present
in case an
209 ABI program calls it.
*/
213 .
type EXT
(__notll
),@function
221 .
size EXT
(__notll
),.Lend
-EXT
(__notll
)
225 /* (void
) __cmov
(char
*dest
, const char
*src
, size_t len
) */
227 * void __cmov
(char
*dest
, const char
*src
, size_t len
)
231 * if (dest < src || dest > src+len)
233 * for (i = 0; i < len; i++)
239 * dest[len] = src[len];
246 .
type EXT
(__cmov
),@function
250 P
(cmp) gr8
, gr9
, icc0
252 P
(cmp) gr8
, gr4
, icc1
256 /* move bytes
in a forward direction
*/
260 P2
(subi
) gr8
, #
1, gr8
263 /* forward
byte move
loop */
265 P
(ldsb
) @
(gr9
, gr5
), gr4
267 P
(stb
) gr4
, @
(gr8
, gr5
)
271 /* backward
byte move
loop body
*/
275 P
(cmpi
) gr10
, #
0, icc0
281 .
size EXT
(__cmov
),.Lend
-EXT
(__cmov
)