2 Copyright (C) 2000-2023 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 3, 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 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
30 /* icc0 = __cmpll (long long a, long long b) */
33 .type EXT(__cmpll),@function
39 P(ccmp) gr9, gr11, cc4, 1
42 .size EXT(__cmpll),.Lend-EXT(__cmpll)
46 /* icc0 = __cmpf (float a, float b) */
47 /* Note, because this function returns the result in ICC0, it means it can't
51 .type EXT(__cmpf),@function
55 #ifdef __FRV_HARD_FLOAT__ /* floating point instructions available */
62 csub gr0, gr8, gr8, cc0, 1
66 #else /* no floating point instructions available */
81 .size EXT(__cmpf),.Lend-EXT(__cmpf)
85 /* icc0 = __cmpd (double a, double b) */
86 /* Note, because this function returns the result in ICC0, it means it can't
90 .type EXT(__cmpd),@function
107 .size EXT(__cmpd),.Lend-EXT(__cmpd)
111 /* gr8,gr9 = __addll (long long a, long long b) */
112 /* Note, gcc will never call this function, but it is present in case an
113 ABI program calls it. */
116 .type EXT(__addll),@function
120 addcc gr9, gr11, gr9, icc0
121 addx gr8, gr10, gr8, icc0
124 .size EXT(__addll),.Lend-EXT(__addll)
128 /* gr8,gr9 = __subll (long long a, long long b) */
129 /* Note, gcc will never call this function, but it is present in case an
130 ABI program calls it. */
133 .type EXT(__subll),@function
137 subcc gr9, gr11, gr9, icc0
138 subx gr8, gr10, gr8, icc0
141 .size EXT(__subll),.Lend-EXT(__subll)
145 /* gr8,gr9 = __andll (long long a, long long b) */
146 /* Note, gcc will never call this function, but it is present in case an
147 ABI program calls it. */
150 .type EXT(__andll),@function
154 P(and) gr9, gr11, gr9
155 P2(and) gr8, gr10, gr8
158 .size EXT(__andll),.Lend-EXT(__andll)
162 /* gr8,gr9 = __orll (long long a, long long b) */
163 /* Note, gcc will never call this function, but it is present in case an
164 ABI program calls it. */
167 .type EXT(__orll),@function
172 P2(or) gr8, gr10, gr8
175 .size EXT(__orll),.Lend-EXT(__orll)
179 /* gr8,gr9 = __xorll (long long a, long long b) */
180 /* Note, gcc will never call this function, but it is present in case an
181 ABI program calls it. */
184 .type EXT(__xorll),@function
188 P(xor) gr9, gr11, gr9
189 P2(xor) gr8, gr10, gr8
192 .size EXT(__xorll),.Lend-EXT(__xorll)
196 /* gr8,gr9 = __notll (long long a) */
197 /* Note, gcc will never call this function, but it is present in case an
198 ABI program calls it. */
201 .type EXT(__notll),@function
209 .size EXT(__notll),.Lend-EXT(__notll)
213 /* (void) __cmov (char *dest, const char *src, size_t len) */
215 * void __cmov (char *dest, const char *src, size_t len)
219 * if (dest < src || dest > src+len)
221 * for (i = 0; i < len; i++)
227 * dest[len] = src[len];
233 .type EXT(__cmov),@function
237 P(cmp) gr8, gr9, icc0
239 P(cmp) gr8, gr4, icc1
243 /* move bytes in a forward direction */
247 P2(subi) gr8, #1, gr8
250 /* forward byte move loop */
252 P(ldsb) @(gr9, gr5), gr4
254 P(stb) gr4, @(gr8, gr5)
258 /* backward byte move loop body */
262 P(cmpi) gr10, #0, icc0
268 .size EXT(__cmov),.Lend-EXT(__cmov)