]>
Commit | Line | Data |
---|---|---|
b1e341a2 | 1 | /* Header file for libgcc2.c. */ |
f1717362 | 2 | /* Copyright (C) 2000-2016 Free Software Foundation, Inc. |
b1e341a2 | 3 | |
f12b58b3 | 4 | This file is part of GCC. |
b1e341a2 | 5 | |
f12b58b3 | 6 | GCC is free software; you can redistribute it and/or modify it under |
7 | the terms of the GNU General Public License as published by the Free | |
6bc9506f | 8 | Software Foundation; either version 3, or (at your option) any later |
f12b58b3 | 9 | version. |
b1e341a2 | 10 | |
f12b58b3 | 11 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | for more details. | |
b1e341a2 | 15 | |
6bc9506f | 16 | Under Section 7 of GPL version 3, you are granted additional |
17 | permissions described in the GCC Runtime Library Exception, version | |
18 | 3.1, as published by the Free Software Foundation. | |
b5c673fc | 19 | |
6bc9506f | 20 | You should have received a copy of the GNU General Public License and |
21 | a copy of the GCC Runtime Library Exception along with this program; | |
22 | see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
23 | <http://www.gnu.org/licenses/>. */ | |
b5c673fc | 24 | |
2a281353 | 25 | #ifndef GCC_LIBGCC2_H |
26 | #define GCC_LIBGCC2_H | |
b1e341a2 | 27 | |
cca0d0c6 | 28 | #ifndef HIDE_EXPORTS |
bc9fbf5d | 29 | #pragma GCC visibility push(default) |
cca0d0c6 | 30 | #endif |
bc9fbf5d | 31 | |
b1e341a2 | 32 | extern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t); |
b1e341a2 | 33 | extern void __clear_cache (char *, char *); |
0bad1e66 | 34 | extern void __eprintf (const char *, const char *, unsigned int, const char *) |
35 | __attribute__ ((__noreturn__)); | |
b1e341a2 | 36 | |
d5957f0d | 37 | #ifdef __LIBGCC_HAS_SF_MODE__ |
38 | #define LIBGCC2_HAS_SF_MODE 1 | |
39 | #else | |
40 | #define LIBGCC2_HAS_SF_MODE 0 | |
ade84c5c | 41 | #endif |
42 | ||
d5957f0d | 43 | #ifdef __LIBGCC_HAS_DF_MODE__ |
44 | #define LIBGCC2_HAS_DF_MODE 1 | |
45 | #else | |
46 | #define LIBGCC2_HAS_DF_MODE 0 | |
30d98e61 | 47 | #endif |
48 | ||
d5957f0d | 49 | #ifdef __LIBGCC_HAS_XF_MODE__ |
50 | #define LIBGCC2_HAS_XF_MODE 1 | |
51 | #else | |
52 | #define LIBGCC2_HAS_XF_MODE 0 | |
30d98e61 | 53 | #endif |
54 | ||
d5957f0d | 55 | #ifdef __LIBGCC_HAS_TF_MODE__ |
56 | #define LIBGCC2_HAS_TF_MODE 1 | |
57 | #else | |
58 | #define LIBGCC2_HAS_TF_MODE 0 | |
30d98e61 | 59 | #endif |
60 | ||
b660d3c6 | 61 | #ifndef __LIBGCC_SF_MANT_DIG__ |
3212edfa | 62 | #if LIBGCC2_HAS_SF_MODE |
b660d3c6 | 63 | #error __LIBGCC_SF_MANT_DIG__ not defined |
3212edfa | 64 | #else |
b660d3c6 | 65 | #define __LIBGCC_SF_MANT_DIG__ 0 |
3212edfa | 66 | #endif |
67 | #endif | |
68 | ||
b660d3c6 | 69 | #ifndef __LIBGCC_DF_MANT_DIG__ |
3212edfa | 70 | #if LIBGCC2_HAS_DF_MODE |
b660d3c6 | 71 | #error __LIBGCC_DF_MANT_DIG__ not defined |
3212edfa | 72 | #else |
b660d3c6 | 73 | #define __LIBGCC_DF_MANT_DIG__ 0 |
3212edfa | 74 | #endif |
75 | #endif | |
76 | ||
b660d3c6 | 77 | #ifndef __LIBGCC_XF_MANT_DIG__ |
3212edfa | 78 | #if LIBGCC2_HAS_XF_MODE |
b660d3c6 | 79 | #error __LIBGCC_XF_MANT_DIG__ not defined |
3212edfa | 80 | #else |
b660d3c6 | 81 | #define __LIBGCC_XF_MANT_DIG__ 0 |
3212edfa | 82 | #endif |
83 | #endif | |
84 | ||
b660d3c6 | 85 | #ifndef __LIBGCC_TF_MANT_DIG__ |
3212edfa | 86 | #if LIBGCC2_HAS_TF_MODE |
b660d3c6 | 87 | #error __LIBGCC_TF_MANT_DIG__ not defined |
3212edfa | 88 | #else |
b660d3c6 | 89 | #define __LIBGCC_TF_MANT_DIG__ 0 |
3212edfa | 90 | #endif |
91 | #endif | |
92 | ||
dc83e3a1 | 93 | /* FIXME: This #ifdef probably should be removed, ie. enable the test |
94 | for mips too. */ | |
d439f3ef | 95 | /* Don't use IBM Extended Double TFmode for TI->SF calculations. |
96 | The conversion from long double to float suffers from double | |
97 | rounding, because we convert via double. In other cases, going | |
98 | through the software fp routines is much slower than the fallback. */ | |
dc83e3a1 | 99 | #ifdef __powerpc__ |
d439f3ef | 100 | #define AVOID_FP_TYPE_CONVERSION(SIZE) (SIZE == 106) |
101 | #elif defined(WIDEST_HARDWARE_FP_SIZE) | |
102 | #define AVOID_FP_TYPE_CONVERSION(SIZE) (SIZE > WIDEST_HARDWARE_FP_SIZE) | |
dc83e3a1 | 103 | #else |
d439f3ef | 104 | #define AVOID_FP_TYPE_CONVERSION(SIZE) 0 |
dc83e3a1 | 105 | #endif |
106 | ||
b1e341a2 | 107 | /* In the first part of this file, we are interfacing to calls generated |
108 | by the compiler itself. These calls pass values into these routines | |
109 | which have very specific modes (rather than very specific types), and | |
110 | these compiler-generated calls also expect any return values to have | |
111 | very specific modes (rather than very specific types). Thus, we need | |
112 | to avoid using regular C language type names in this part of the file | |
113 | because the sizes for those types can be configured to be anything. | |
114 | Instead we use the following special type names. */ | |
115 | ||
116 | typedef int QItype __attribute__ ((mode (QI))); | |
117 | typedef unsigned int UQItype __attribute__ ((mode (QI))); | |
118 | typedef int HItype __attribute__ ((mode (HI))); | |
119 | typedef unsigned int UHItype __attribute__ ((mode (HI))); | |
5ae419e6 | 120 | #if MIN_UNITS_PER_WORD > 1 |
8b332087 | 121 | /* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1. */ |
b1e341a2 | 122 | typedef int SItype __attribute__ ((mode (SI))); |
123 | typedef unsigned int USItype __attribute__ ((mode (SI))); | |
a305fd90 | 124 | #if __SIZEOF_LONG_LONG__ > 4 |
8b332087 | 125 | /* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2. */ |
b1e341a2 | 126 | typedef int DItype __attribute__ ((mode (DI))); |
127 | typedef unsigned int UDItype __attribute__ ((mode (DI))); | |
d1138980 | 128 | #if MIN_UNITS_PER_WORD > 4 |
8b332087 | 129 | /* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4. */ |
d1138980 | 130 | typedef int TItype __attribute__ ((mode (TI))); |
131 | typedef unsigned int UTItype __attribute__ ((mode (TI))); | |
132 | #endif | |
b1e341a2 | 133 | #endif |
134 | #endif | |
135 | ||
ade84c5c | 136 | #if LIBGCC2_HAS_SF_MODE |
b1e341a2 | 137 | typedef float SFtype __attribute__ ((mode (SF))); |
0dfc45b5 | 138 | typedef _Complex float SCtype __attribute__ ((mode (SC))); |
ade84c5c | 139 | #endif |
30d98e61 | 140 | #if LIBGCC2_HAS_DF_MODE |
fe2f5693 | 141 | typedef float DFtype __attribute__ ((mode (DF))); |
142 | typedef _Complex float DCtype __attribute__ ((mode (DC))); | |
143 | #endif | |
30d98e61 | 144 | #if LIBGCC2_HAS_XF_MODE |
b1e341a2 | 145 | typedef float XFtype __attribute__ ((mode (XF))); |
0dfc45b5 | 146 | typedef _Complex float XCtype __attribute__ ((mode (XC))); |
b1e341a2 | 147 | #endif |
30d98e61 | 148 | #if LIBGCC2_HAS_TF_MODE |
b1e341a2 | 149 | typedef float TFtype __attribute__ ((mode (TF))); |
0dfc45b5 | 150 | typedef _Complex float TCtype __attribute__ ((mode (TC))); |
b1e341a2 | 151 | #endif |
152 | ||
0ef89dfd | 153 | typedef int cmp_return_type __attribute__((mode (__libgcc_cmp_return__))); |
154 | typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__))); | |
b1e341a2 | 155 | |
156 | /* Make sure that we don't accidentally use any normal C language built-in | |
157 | type names in the first part of this file. Instead we want to use *only* | |
158 | the type names defined above. The following macro definitions insure | |
159 | that if we *do* accidentally use some normal C language built-in type name, | |
160 | we will get a syntax error. */ | |
161 | ||
162 | #define char bogus_type | |
163 | #define short bogus_type | |
164 | #define int bogus_type | |
165 | #define long bogus_type | |
166 | #define unsigned bogus_type | |
167 | #define float bogus_type | |
168 | #define double bogus_type | |
169 | ||
ad7a5867 | 170 | /* Versions prior to 3.4.4 were not taking into account the word size for |
171 | the 5 trapping arithmetic functions absv, addv, subv, mulv and negv. As | |
172 | a consequence, the si and di variants were always and the only ones emitted. | |
173 | To maintain backward compatibility, COMPAT_SIMODE_TRAPPING_ARITHMETIC is | |
174 | defined on platforms where it makes sense to still have the si variants | |
175 | emitted. As a bonus, their implementation is now correct. Note that the | |
176 | same mechanism should have been implemented for the di variants, but it | |
177 | turns out that no platform would define COMPAT_DIMODE_TRAPPING_ARITHMETIC | |
178 | if it existed. */ | |
179 | ||
0e8499c7 | 180 | #if LIBGCC2_UNITS_PER_WORD == 8 |
d2dc729f | 181 | #define W_TYPE_SIZE (8 * __CHAR_BIT__) |
d1138980 | 182 | #define Wtype DItype |
183 | #define UWtype UDItype | |
184 | #define HWtype DItype | |
185 | #define UHWtype UDItype | |
186 | #define DWtype TItype | |
187 | #define UDWtype UTItype | |
f308a9b2 | 188 | #ifdef LIBGCC2_GNU_PREFIX |
189 | #define __NW(a,b) __gnu_ ## a ## di ## b | |
190 | #define __NDW(a,b) __gnu_ ## a ## ti ## b | |
191 | #else | |
d1138980 | 192 | #define __NW(a,b) __ ## a ## di ## b |
193 | #define __NDW(a,b) __ ## a ## ti ## b | |
f308a9b2 | 194 | #endif |
ad7a5867 | 195 | #define COMPAT_SIMODE_TRAPPING_ARITHMETIC |
0e8499c7 | 196 | #elif LIBGCC2_UNITS_PER_WORD == 4 |
d2dc729f | 197 | #define W_TYPE_SIZE (4 * __CHAR_BIT__) |
b1e341a2 | 198 | #define Wtype SItype |
199 | #define UWtype USItype | |
200 | #define HWtype SItype | |
201 | #define UHWtype USItype | |
202 | #define DWtype DItype | |
203 | #define UDWtype UDItype | |
f308a9b2 | 204 | #ifdef LIBGCC2_GNU_PREFIX |
205 | #define __NW(a,b) __gnu_ ## a ## si ## b | |
206 | #define __NDW(a,b) __gnu_ ## a ## di ## b | |
207 | #else | |
b1e341a2 | 208 | #define __NW(a,b) __ ## a ## si ## b |
209 | #define __NDW(a,b) __ ## a ## di ## b | |
f308a9b2 | 210 | #endif |
0e8499c7 | 211 | #elif LIBGCC2_UNITS_PER_WORD == 2 |
d2dc729f | 212 | #define W_TYPE_SIZE (2 * __CHAR_BIT__) |
b1e341a2 | 213 | #define Wtype HItype |
214 | #define UWtype UHItype | |
215 | #define HWtype HItype | |
216 | #define UHWtype UHItype | |
217 | #define DWtype SItype | |
218 | #define UDWtype USItype | |
f308a9b2 | 219 | #ifdef LIBGCC2_GNU_PREFIX |
220 | #define __NW(a,b) __gnu_ ## a ## hi ## b | |
221 | #define __NDW(a,b) __gnu_ ## a ## si ## b | |
222 | #else | |
b1e341a2 | 223 | #define __NW(a,b) __ ## a ## hi ## b |
224 | #define __NDW(a,b) __ ## a ## si ## b | |
f308a9b2 | 225 | #endif |
b1e341a2 | 226 | #else |
d2dc729f | 227 | #define W_TYPE_SIZE __CHAR_BIT__ |
b1e341a2 | 228 | #define Wtype QItype |
229 | #define UWtype UQItype | |
230 | #define HWtype QItype | |
231 | #define UHWtype UQItype | |
232 | #define DWtype HItype | |
233 | #define UDWtype UHItype | |
f308a9b2 | 234 | #ifdef LIBGCC2_GNU_PREFIX |
235 | #define __NW(a,b) __gnu_ ## a ## qi ## b | |
236 | #define __NDW(a,b) __gnu_ ## a ## hi ## b | |
237 | #else | |
b1e341a2 | 238 | #define __NW(a,b) __ ## a ## qi ## b |
239 | #define __NDW(a,b) __ ## a ## hi ## b | |
240 | #endif | |
f308a9b2 | 241 | #endif |
b1e341a2 | 242 | |
f308a9b2 | 243 | #ifdef LIBGCC2_GNU_PREFIX |
244 | #define __N(a) __gnu_ ## a | |
245 | #else | |
246 | #define __N(a) __ ## a | |
247 | #endif | |
7429c938 | 248 | #define Wtype_MAX ((Wtype)(((UWtype)1 << (W_TYPE_SIZE - 1)) - 1)) |
249 | #define Wtype_MIN (- Wtype_MAX - 1) | |
250 | ||
fe2f5693 | 251 | #if W_TYPE_SIZE == 8 |
252 | # define Wtype_MAXp1_F 0x1p8f | |
253 | #elif W_TYPE_SIZE == 16 | |
254 | # define Wtype_MAXp1_F 0x1p16f | |
255 | #elif W_TYPE_SIZE == 32 | |
256 | # define Wtype_MAXp1_F 0x1p32f | |
257 | #elif W_TYPE_SIZE == 64 | |
258 | # define Wtype_MAXp1_F 0x1p64f | |
259 | #else | |
260 | # error "expand the table" | |
261 | #endif | |
262 | ||
d1138980 | 263 | #define __muldi3 __NDW(mul,3) |
264 | #define __divdi3 __NDW(div,3) | |
265 | #define __udivdi3 __NDW(udiv,3) | |
266 | #define __moddi3 __NDW(mod,3) | |
267 | #define __umoddi3 __NDW(umod,3) | |
268 | #define __negdi2 __NDW(neg,2) | |
269 | #define __lshrdi3 __NDW(lshr,3) | |
270 | #define __ashldi3 __NDW(ashl,3) | |
271 | #define __ashrdi3 __NDW(ashr,3) | |
d1138980 | 272 | #define __cmpdi2 __NDW(cmp,2) |
273 | #define __ucmpdi2 __NDW(ucmp,2) | |
274 | #define __udivmoddi4 __NDW(udivmod,4) | |
275 | #define __fixunstfDI __NDW(fixunstf,) | |
276 | #define __fixtfdi __NDW(fixtf,) | |
277 | #define __fixunsxfDI __NDW(fixunsxf,) | |
278 | #define __fixxfdi __NDW(fixxf,) | |
279 | #define __fixunsdfDI __NDW(fixunsdf,) | |
280 | #define __fixdfdi __NDW(fixdf,) | |
281 | #define __fixunssfDI __NDW(fixunssf,) | |
282 | #define __fixsfdi __NDW(fixsf,) | |
283 | #define __floatdixf __NDW(float,xf) | |
284 | #define __floatditf __NDW(float,tf) | |
285 | #define __floatdidf __NDW(float,df) | |
286 | #define __floatdisf __NDW(float,sf) | |
4f5bcdbd | 287 | #define __floatundixf __NDW(floatun,xf) |
288 | #define __floatunditf __NDW(floatun,tf) | |
289 | #define __floatundidf __NDW(floatun,df) | |
290 | #define __floatundisf __NDW(floatun,sf) | |
d1138980 | 291 | #define __fixunsxfSI __NW(fixunsxf,) |
292 | #define __fixunstfSI __NW(fixunstf,) | |
293 | #define __fixunsdfSI __NW(fixunsdf,) | |
294 | #define __fixunssfSI __NW(fixunssf,) | |
295 | ||
ad7a5867 | 296 | #define __absvSI2 __NW(absv,2) |
297 | #define __addvSI3 __NW(addv,3) | |
298 | #define __subvSI3 __NW(subv,3) | |
299 | #define __mulvSI3 __NW(mulv,3) | |
300 | #define __negvSI2 __NW(negv,2) | |
301 | #define __absvDI2 __NDW(absv,2) | |
302 | #define __addvDI3 __NDW(addv,3) | |
303 | #define __subvDI3 __NDW(subv,3) | |
304 | #define __mulvDI3 __NDW(mulv,3) | |
305 | #define __negvDI2 __NDW(negv,2) | |
306 | ||
092445b3 | 307 | #define __ffsSI2 __NW(ffs,2) |
0f186426 | 308 | #define __clzSI2 __NW(clz,2) |
309 | #define __ctzSI2 __NW(ctz,2) | |
d8492bd3 | 310 | #define __clrsbSI2 __NW(clrsb,2) |
0f186426 | 311 | #define __popcountSI2 __NW(popcount,2) |
312 | #define __paritySI2 __NW(parity,2) | |
092445b3 | 313 | #define __ffsDI2 __NDW(ffs,2) |
0f186426 | 314 | #define __clzDI2 __NDW(clz,2) |
315 | #define __ctzDI2 __NDW(ctz,2) | |
d8492bd3 | 316 | #define __clrsbDI2 __NDW(clrsb,2) |
0f186426 | 317 | #define __popcountDI2 __NDW(popcount,2) |
318 | #define __parityDI2 __NDW(parity,2) | |
092445b3 | 319 | |
f308a9b2 | 320 | #define __clz_tab __N(clz_tab) |
7be359e3 | 321 | #define __bswapsi2 __N(bswapsi2) |
322 | #define __bswapdi2 __N(bswapdi2) | |
323 | #define __udiv_w_sdiv __N(udiv_w_sdiv) | |
324 | #define __clear_cache __N(clear_cache) | |
325 | #define __enable_execute_stack __N(enable_execute_stack) | |
326 | ||
327 | #ifndef __powisf2 | |
f308a9b2 | 328 | #define __powisf2 __N(powisf2) |
7be359e3 | 329 | #endif |
330 | #ifndef __powidf2 | |
f308a9b2 | 331 | #define __powidf2 __N(powidf2) |
7be359e3 | 332 | #endif |
333 | #ifndef __powitf2 | |
f308a9b2 | 334 | #define __powitf2 __N(powitf2) |
7be359e3 | 335 | #endif |
336 | #ifndef __powixf2 | |
f308a9b2 | 337 | #define __powixf2 __N(powixf2) |
7be359e3 | 338 | #endif |
339 | #ifndef __mulsc3 | |
f308a9b2 | 340 | #define __mulsc3 __N(mulsc3) |
7be359e3 | 341 | #endif |
342 | #ifndef __muldc3 | |
f308a9b2 | 343 | #define __muldc3 __N(muldc3) |
7be359e3 | 344 | #endif |
345 | #ifndef __mulxc3 | |
f308a9b2 | 346 | #define __mulxc3 __N(mulxc3) |
7be359e3 | 347 | #endif |
348 | #ifndef __multc3 | |
f308a9b2 | 349 | #define __multc3 __N(multc3) |
7be359e3 | 350 | #endif |
351 | #ifndef __divsc3 | |
f308a9b2 | 352 | #define __divsc3 __N(divsc3) |
7be359e3 | 353 | #endif |
354 | #ifndef __divdc3 | |
f308a9b2 | 355 | #define __divdc3 __N(divdc3) |
7be359e3 | 356 | #endif |
357 | #ifndef __divxc3 | |
f308a9b2 | 358 | #define __divxc3 __N(divxc3) |
7be359e3 | 359 | #endif |
360 | #ifndef __divtc3 | |
f308a9b2 | 361 | #define __divtc3 __N(divtc3) |
7be359e3 | 362 | #endif |
f308a9b2 | 363 | |
ce35e6f4 | 364 | extern DWtype __muldi3 (DWtype, DWtype); |
365 | extern DWtype __divdi3 (DWtype, DWtype); | |
366 | extern UDWtype __udivdi3 (UDWtype, UDWtype); | |
367 | extern UDWtype __umoddi3 (UDWtype, UDWtype); | |
368 | extern DWtype __moddi3 (DWtype, DWtype); | |
d1138980 | 369 | |
ce35e6f4 | 370 | /* __udivmoddi4 is static inline when building other libgcc2 portions. */ |
371 | #if (!defined (L_udivdi3) && !defined (L_divdi3) && \ | |
372 | !defined (L_umoddi3) && !defined (L_moddi3)) | |
373 | extern UDWtype __udivmoddi4 (UDWtype, UDWtype, UDWtype *); | |
374 | #endif | |
375 | ||
376 | /* __negdi2 is static inline when building other libgcc2 portions. */ | |
377 | #if !defined(L_divdi3) && !defined(L_moddi3) | |
378 | extern DWtype __negdi2 (DWtype); | |
379 | #endif | |
380 | ||
0ef89dfd | 381 | extern DWtype __lshrdi3 (DWtype, shift_count_type); |
382 | extern DWtype __ashldi3 (DWtype, shift_count_type); | |
383 | extern DWtype __ashrdi3 (DWtype, shift_count_type); | |
6a08d0ab | 384 | |
ce35e6f4 | 385 | /* __udiv_w_sdiv is static inline when building other libgcc2 portions. */ |
386 | #if (!defined(L_udivdi3) && !defined(L_divdi3) && \ | |
387 | !defined(L_umoddi3) && !defined(L_moddi3)) | |
388 | extern UWtype __udiv_w_sdiv (UWtype *, UWtype, UWtype, UWtype); | |
389 | #endif | |
390 | ||
0ef89dfd | 391 | extern cmp_return_type __cmpdi2 (DWtype, DWtype); |
392 | extern cmp_return_type __ucmpdi2 (DWtype, DWtype); | |
ce35e6f4 | 393 | |
d2b0211b | 394 | #if MIN_UNITS_PER_WORD > 1 |
395 | extern SItype __bswapsi2 (SItype); | |
396 | #endif | |
a305fd90 | 397 | #if __SIZEOF_LONG_LONG__ > 4 |
d2b0211b | 398 | extern DItype __bswapdi2 (DItype); |
399 | #endif | |
400 | ||
ad7a5867 | 401 | extern Wtype __absvSI2 (Wtype); |
402 | extern Wtype __addvSI3 (Wtype, Wtype); | |
403 | extern Wtype __subvSI3 (Wtype, Wtype); | |
404 | extern Wtype __mulvSI3 (Wtype, Wtype); | |
405 | extern Wtype __negvSI2 (Wtype); | |
406 | extern DWtype __absvDI2 (DWtype); | |
407 | extern DWtype __addvDI3 (DWtype, DWtype); | |
408 | extern DWtype __subvDI3 (DWtype, DWtype); | |
409 | extern DWtype __mulvDI3 (DWtype, DWtype); | |
410 | extern DWtype __negvDI2 (DWtype); | |
411 | ||
412 | #ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC | |
f308a9b2 | 413 | #define __absvsi2 __N(absvsi2) |
414 | #define __negvsi2 __N(negvsi2) | |
415 | #define __addvsi3 __N(addvsi3) | |
416 | #define __subvsi3 __N(subvsi3) | |
417 | #define __mulvsi3 __N(mulvsi3) | |
418 | ||
ad7a5867 | 419 | extern SItype __absvsi2 (SItype); |
420 | extern SItype __addvsi3 (SItype, SItype); | |
421 | extern SItype __subvsi3 (SItype, SItype); | |
422 | extern SItype __mulvsi3 (SItype, SItype); | |
423 | extern SItype __negvsi2 (SItype); | |
424 | #endif /* COMPAT_SIMODE_TRAPPING_ARITHMETIC */ | |
98de4f3f | 425 | |
d0405f40 | 426 | #undef int |
ade84c5c | 427 | #if LIBGCC2_HAS_SF_MODE |
ce35e6f4 | 428 | extern DWtype __fixsfdi (SFtype); |
ce35e6f4 | 429 | extern SFtype __floatdisf (DWtype); |
4f5bcdbd | 430 | extern SFtype __floatundisf (UDWtype); |
d1138980 | 431 | extern UWtype __fixunssfSI (SFtype); |
ba131df0 | 432 | extern UDWtype __fixunssfDI (SFtype); |
d0405f40 | 433 | extern SFtype __powisf2 (SFtype, int); |
0dfc45b5 | 434 | extern SCtype __divsc3 (SFtype, SFtype, SFtype, SFtype); |
435 | extern SCtype __mulsc3 (SFtype, SFtype, SFtype, SFtype); | |
ade84c5c | 436 | #endif |
30d98e61 | 437 | #if LIBGCC2_HAS_DF_MODE |
fe2f5693 | 438 | extern DWtype __fixdfdi (DFtype); |
439 | extern DFtype __floatdidf (DWtype); | |
4f5bcdbd | 440 | extern DFtype __floatundidf (UDWtype); |
fe2f5693 | 441 | extern UWtype __fixunsdfSI (DFtype); |
ba131df0 | 442 | extern UDWtype __fixunsdfDI (DFtype); |
d0405f40 | 443 | extern DFtype __powidf2 (DFtype, int); |
0dfc45b5 | 444 | extern DCtype __divdc3 (DFtype, DFtype, DFtype, DFtype); |
445 | extern DCtype __muldc3 (DFtype, DFtype, DFtype, DFtype); | |
fe2f5693 | 446 | #endif |
0dfc45b5 | 447 | |
30d98e61 | 448 | #if LIBGCC2_HAS_XF_MODE |
ce35e6f4 | 449 | extern DWtype __fixxfdi (XFtype); |
ba131df0 | 450 | extern UDWtype __fixunsxfDI (XFtype); |
ce35e6f4 | 451 | extern XFtype __floatdixf (DWtype); |
4f5bcdbd | 452 | extern XFtype __floatundixf (UDWtype); |
d1138980 | 453 | extern UWtype __fixunsxfSI (XFtype); |
d0405f40 | 454 | extern XFtype __powixf2 (XFtype, int); |
0dfc45b5 | 455 | extern XCtype __divxc3 (XFtype, XFtype, XFtype, XFtype); |
456 | extern XCtype __mulxc3 (XFtype, XFtype, XFtype, XFtype); | |
ce35e6f4 | 457 | #endif |
458 | ||
30d98e61 | 459 | #if LIBGCC2_HAS_TF_MODE |
ba131df0 | 460 | extern UDWtype __fixunstfDI (TFtype); |
ce35e6f4 | 461 | extern DWtype __fixtfdi (TFtype); |
462 | extern TFtype __floatditf (DWtype); | |
4f5bcdbd | 463 | extern TFtype __floatunditf (UDWtype); |
d0405f40 | 464 | extern TFtype __powitf2 (TFtype, int); |
0dfc45b5 | 465 | extern TCtype __divtc3 (TFtype, TFtype, TFtype, TFtype); |
466 | extern TCtype __multc3 (TFtype, TFtype, TFtype, TFtype); | |
ce35e6f4 | 467 | #endif |
d0405f40 | 468 | #define int bogus_type |
ce35e6f4 | 469 | |
b1e341a2 | 470 | /* DWstructs are pairs of Wtype values in the order determined by |
f6e5e456 | 471 | __BYTE_ORDER__. */ |
b1e341a2 | 472 | |
f6e5e456 | 473 | #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ |
b1e341a2 | 474 | struct DWstruct {Wtype high, low;}; |
475 | #else | |
476 | struct DWstruct {Wtype low, high;}; | |
477 | #endif | |
478 | ||
479 | /* We need this union to unpack/pack DImode values, since we don't have | |
480 | any arithmetic yet. Incoming DImode parameters are stored into the | |
481 | `ll' field, and the unpacked result is read from the struct `s'. */ | |
482 | ||
483 | typedef union | |
484 | { | |
485 | struct DWstruct s; | |
486 | DWtype ll; | |
487 | } DWunion; | |
488 | ||
2f26863b | 489 | /* Defined for L_popcount_tab. Exported here because some targets may |
490 | want to use it for their own versions of the __popcount builtins. */ | |
491 | extern const UQItype __popcount_tab[256]; | |
492 | ||
493 | /* Defined for L_clz. Exported here because some targets may want to use | |
494 | it for their own versions of the __clz builtins. It contains the bit | |
495 | position of the first set bit for the numbers 0 - 255. This avoids the | |
554f2707 | 496 | need for a separate table for the __ctz builtins. */ |
2f26863b | 497 | extern const UQItype __clz_tab[256]; |
498 | ||
b1e341a2 | 499 | #include "longlong.h" |
500 | ||
bc9fbf5d | 501 | #undef int |
502 | extern int __clzDI2 (UDWtype); | |
503 | extern int __clzSI2 (UWtype); | |
504 | extern int __ctzSI2 (UWtype); | |
d8492bd3 | 505 | extern int __ctzDI2 (UDWtype); |
506 | extern int __clrsbSI2 (Wtype); | |
507 | extern int __clrsbDI2 (DWtype); | |
bc9fbf5d | 508 | extern int __ffsSI2 (UWtype); |
509 | extern int __ffsDI2 (DWtype); | |
bc9fbf5d | 510 | extern int __popcountSI2 (UWtype); |
511 | extern int __popcountDI2 (UDWtype); | |
512 | extern int __paritySI2 (UWtype); | |
513 | extern int __parityDI2 (UDWtype); | |
514 | #define int bogus_type | |
515 | ||
516 | extern void __enable_execute_stack (void *); | |
517 | ||
cca0d0c6 | 518 | #ifndef HIDE_EXPORTS |
bc9fbf5d | 519 | #pragma GCC visibility pop |
cca0d0c6 | 520 | #endif |
bc9fbf5d | 521 | |
2a281353 | 522 | #endif /* ! GCC_LIBGCC2_H */ |