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) */
36 .type EXT(__cmpll),@function
42 P(ccmp) gr9, gr11, cc4, 1
45 .size EXT(__cmpll),.Lend-EXT(__cmpll)
49 /* icc0 = __cmpf (float a, float b) */
50 /* Note, because this function returns the result in ICC0, it means it can't
54 .type EXT(__cmpf),@function
58 #ifdef __FRV_HARD_FLOAT__ /* floating point instructions available */
65 csub gr0, gr8, gr8, cc0, 1
69 #else /* no floating point instructions available */
84 .size EXT(__cmpf),.Lend-EXT(__cmpf)
88 /* icc0 = __cmpd (double a, double b) */
89 /* Note, because this function returns the result in ICC0, it means it can't
93 .type EXT(__cmpd),@function
110 .size EXT(__cmpd),.Lend-EXT(__cmpd)
114 /* gr8,gr9 = __addll (long long a, long long b) */
115 /* Note, gcc will never call this function, but it is present in case an
116 ABI program calls it. */
119 .type EXT(__addll),@function
123 addcc gr9, gr11, gr9, icc0
124 addx gr8, gr10, gr8, icc0
127 .size EXT(__addll),.Lend-EXT(__addll)
131 /* gr8,gr9 = __subll (long long a, long long b) */
132 /* Note, gcc will never call this function, but it is present in case an
133 ABI program calls it. */
136 .type EXT(__subll),@function
140 subcc gr9, gr11, gr9, icc0
141 subx gr8, gr10, gr8, icc0
144 .size EXT(__subll),.Lend-EXT(__subll)
148 /* gr8,gr9 = __andll (long long a, long long b) */
149 /* Note, gcc will never call this function, but it is present in case an
150 ABI program calls it. */
153 .type EXT(__andll),@function
157 P(and) gr9, gr11, gr9
158 P2(and) gr8, gr10, gr8
161 .size EXT(__andll),.Lend-EXT(__andll)
165 /* gr8,gr9 = __orll (long long a, long long b) */
166 /* Note, gcc will never call this function, but it is present in case an
167 ABI program calls it. */
170 .type EXT(__orll),@function
175 P2(or) gr8, gr10, gr8
178 .size EXT(__orll),.Lend-EXT(__orll)
182 /* gr8,gr9 = __xorll (long long a, long long b) */
183 /* Note, gcc will never call this function, but it is present in case an
184 ABI program calls it. */
187 .type EXT(__xorll),@function
191 P(xor) gr9, gr11, gr9
192 P2(xor) gr8, gr10, gr8
195 .size EXT(__xorll),.Lend-EXT(__xorll)
199 /* gr8,gr9 = __notll (long long a) */
200 /* Note, gcc will never call this function, but it is present in case an
201 ABI program calls it. */
204 .type EXT(__notll),@function
212 .size EXT(__notll),.Lend-EXT(__notll)
216 /* (void) __cmov (char *dest, const char *src, size_t len) */
218 * void __cmov (char *dest, const char *src, size_t len)
222 * if (dest < src || dest > src+len)
224 * for (i = 0; i < len; i++)
230 * dest[len] = src[len];
236 .type EXT(__cmov),@function
240 P(cmp) gr8, gr9, icc0
242 P(cmp) gr8, gr4, icc1
246 /* move bytes in a forward direction */
250 P2(subi) gr8, #1, gr8
253 /* forward byte move loop */
255 P(ldsb) @(gr9, gr5), gr4
257 P(stb) gr4, @(gr8, gr5)
261 /* backward byte move loop body */
265 P(cmpi) gr10, #0, icc0
271 .size EXT(__cmov),.Lend-EXT(__cmov)