]>
Commit | Line | Data |
---|---|---|
299b83b7 | 1 | /* Header file for libgcc2.c. */ |
a945c346 | 2 | /* Copyright (C) 2000-2024 Free Software Foundation, Inc. |
299b83b7 | 3 | |
1322177d | 4 | This file is part of GCC. |
299b83b7 | 5 | |
1322177d LB |
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 | |
748086b7 | 8 | Software Foundation; either version 3, or (at your option) any later |
1322177d | 9 | version. |
299b83b7 | 10 | |
1322177d LB |
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. | |
299b83b7 | 15 | |
748086b7 JJ |
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. | |
77c915d8 | 19 | |
748086b7 JJ |
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/>. */ | |
77c915d8 | 24 | |
88657302 RH |
25 | #ifndef GCC_LIBGCC2_H |
26 | #define GCC_LIBGCC2_H | |
299b83b7 | 27 | |
7370bebd | 28 | #ifndef HIDE_EXPORTS |
3fc1f660 | 29 | #pragma GCC visibility push(default) |
7370bebd | 30 | #endif |
3fc1f660 | 31 | |
e9b2f15d | 32 | extern void __gcc_nested_func_ptr_created (void *, void *, void *); |
837827f8 | 33 | extern void __gcc_nested_func_ptr_deleted (void); |
8abddb18 | 34 | |
299b83b7 | 35 | extern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t); |
a90b0cdd | 36 | extern void __clear_cache (void *, void *); |
3fe68d0a ZW |
37 | extern void __eprintf (const char *, const char *, unsigned int, const char *) |
38 | __attribute__ ((__noreturn__)); | |
299b83b7 | 39 | |
0abcd6cc JG |
40 | #ifdef __LIBGCC_HAS_HF_MODE__ |
41 | #define LIBGCC2_HAS_HF_MODE 1 | |
42 | #else | |
43 | #define LIBGCC2_HAS_HF_MODE 0 | |
44 | #endif | |
45 | ||
8cc4b7a2 JM |
46 | #ifdef __LIBGCC_HAS_SF_MODE__ |
47 | #define LIBGCC2_HAS_SF_MODE 1 | |
48 | #else | |
49 | #define LIBGCC2_HAS_SF_MODE 0 | |
cfa7bd9c RS |
50 | #endif |
51 | ||
8cc4b7a2 JM |
52 | #ifdef __LIBGCC_HAS_DF_MODE__ |
53 | #define LIBGCC2_HAS_DF_MODE 1 | |
54 | #else | |
55 | #define LIBGCC2_HAS_DF_MODE 0 | |
4e9db8b2 SE |
56 | #endif |
57 | ||
8cc4b7a2 JM |
58 | #ifdef __LIBGCC_HAS_XF_MODE__ |
59 | #define LIBGCC2_HAS_XF_MODE 1 | |
60 | #else | |
61 | #define LIBGCC2_HAS_XF_MODE 0 | |
4e9db8b2 SE |
62 | #endif |
63 | ||
8cc4b7a2 JM |
64 | #ifdef __LIBGCC_HAS_TF_MODE__ |
65 | #define LIBGCC2_HAS_TF_MODE 1 | |
66 | #else | |
67 | #define LIBGCC2_HAS_TF_MODE 0 | |
4e9db8b2 SE |
68 | #endif |
69 | ||
66bb34c0 | 70 | #ifndef __LIBGCC_SF_MANT_DIG__ |
4a73d865 | 71 | #if LIBGCC2_HAS_SF_MODE |
66bb34c0 | 72 | #error __LIBGCC_SF_MANT_DIG__ not defined |
4a73d865 | 73 | #else |
66bb34c0 | 74 | #define __LIBGCC_SF_MANT_DIG__ 0 |
4a73d865 JM |
75 | #endif |
76 | #endif | |
77 | ||
66bb34c0 | 78 | #ifndef __LIBGCC_DF_MANT_DIG__ |
4a73d865 | 79 | #if LIBGCC2_HAS_DF_MODE |
66bb34c0 | 80 | #error __LIBGCC_DF_MANT_DIG__ not defined |
4a73d865 | 81 | #else |
66bb34c0 | 82 | #define __LIBGCC_DF_MANT_DIG__ 0 |
4a73d865 JM |
83 | #endif |
84 | #endif | |
85 | ||
66bb34c0 | 86 | #ifndef __LIBGCC_XF_MANT_DIG__ |
4a73d865 | 87 | #if LIBGCC2_HAS_XF_MODE |
66bb34c0 | 88 | #error __LIBGCC_XF_MANT_DIG__ not defined |
4a73d865 | 89 | #else |
66bb34c0 | 90 | #define __LIBGCC_XF_MANT_DIG__ 0 |
4a73d865 JM |
91 | #endif |
92 | #endif | |
93 | ||
66bb34c0 | 94 | #ifndef __LIBGCC_TF_MANT_DIG__ |
4a73d865 | 95 | #if LIBGCC2_HAS_TF_MODE |
66bb34c0 | 96 | #error __LIBGCC_TF_MANT_DIG__ not defined |
4a73d865 | 97 | #else |
66bb34c0 | 98 | #define __LIBGCC_TF_MANT_DIG__ 0 |
4a73d865 JM |
99 | #endif |
100 | #endif | |
101 | ||
b04c9063 AM |
102 | /* FIXME: This #ifdef probably should be removed, ie. enable the test |
103 | for mips too. */ | |
5fb54b91 RH |
104 | /* Don't use IBM Extended Double TFmode for TI->SF calculations. |
105 | The conversion from long double to float suffers from double | |
106 | rounding, because we convert via double. In other cases, going | |
107 | through the software fp routines is much slower than the fallback. */ | |
b04c9063 | 108 | #ifdef __powerpc__ |
5fb54b91 RH |
109 | #define AVOID_FP_TYPE_CONVERSION(SIZE) (SIZE == 106) |
110 | #elif defined(WIDEST_HARDWARE_FP_SIZE) | |
111 | #define AVOID_FP_TYPE_CONVERSION(SIZE) (SIZE > WIDEST_HARDWARE_FP_SIZE) | |
b04c9063 | 112 | #else |
5fb54b91 | 113 | #define AVOID_FP_TYPE_CONVERSION(SIZE) 0 |
b04c9063 AM |
114 | #endif |
115 | ||
299b83b7 KG |
116 | /* In the first part of this file, we are interfacing to calls generated |
117 | by the compiler itself. These calls pass values into these routines | |
118 | which have very specific modes (rather than very specific types), and | |
119 | these compiler-generated calls also expect any return values to have | |
120 | very specific modes (rather than very specific types). Thus, we need | |
121 | to avoid using regular C language type names in this part of the file | |
122 | because the sizes for those types can be configured to be anything. | |
123 | Instead we use the following special type names. */ | |
124 | ||
125 | typedef int QItype __attribute__ ((mode (QI))); | |
126 | typedef unsigned int UQItype __attribute__ ((mode (QI))); | |
127 | typedef int HItype __attribute__ ((mode (HI))); | |
128 | typedef unsigned int UHItype __attribute__ ((mode (HI))); | |
aa63d244 | 129 | #if MIN_UNITS_PER_WORD > 1 |
6614fd40 | 130 | /* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1. */ |
299b83b7 KG |
131 | typedef int SItype __attribute__ ((mode (SI))); |
132 | typedef unsigned int USItype __attribute__ ((mode (SI))); | |
4471aff6 | 133 | #if __SIZEOF_LONG_LONG__ > 4 |
6614fd40 | 134 | /* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2. */ |
299b83b7 KG |
135 | typedef int DItype __attribute__ ((mode (DI))); |
136 | typedef unsigned int UDItype __attribute__ ((mode (DI))); | |
6da9c622 | 137 | #if MIN_UNITS_PER_WORD > 4 |
6614fd40 | 138 | /* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4. */ |
6da9c622 RK |
139 | typedef int TItype __attribute__ ((mode (TI))); |
140 | typedef unsigned int UTItype __attribute__ ((mode (TI))); | |
141 | #endif | |
299b83b7 KG |
142 | #endif |
143 | #endif | |
144 | ||
0abcd6cc JG |
145 | #if LIBGCC2_HAS_HF_MODE |
146 | typedef float HFtype __attribute__ ((mode (HF))); | |
147 | typedef _Complex float HCtype __attribute__ ((mode (HC))); | |
148 | #endif | |
cfa7bd9c | 149 | #if LIBGCC2_HAS_SF_MODE |
299b83b7 | 150 | typedef float SFtype __attribute__ ((mode (SF))); |
7e7e470f | 151 | typedef _Complex float SCtype __attribute__ ((mode (SC))); |
cfa7bd9c | 152 | #endif |
4e9db8b2 | 153 | #if LIBGCC2_HAS_DF_MODE |
4f2e0d5e RH |
154 | typedef float DFtype __attribute__ ((mode (DF))); |
155 | typedef _Complex float DCtype __attribute__ ((mode (DC))); | |
156 | #endif | |
4e9db8b2 | 157 | #if LIBGCC2_HAS_XF_MODE |
299b83b7 | 158 | typedef float XFtype __attribute__ ((mode (XF))); |
7e7e470f | 159 | typedef _Complex float XCtype __attribute__ ((mode (XC))); |
299b83b7 | 160 | #endif |
4e9db8b2 | 161 | #if LIBGCC2_HAS_TF_MODE |
306c7b1a | 162 | #ifndef TFtype |
299b83b7 | 163 | typedef float TFtype __attribute__ ((mode (TF))); |
306c7b1a MM |
164 | #endif |
165 | #ifndef TCtype | |
7e7e470f | 166 | typedef _Complex float TCtype __attribute__ ((mode (TC))); |
299b83b7 | 167 | #endif |
306c7b1a | 168 | #endif |
299b83b7 | 169 | |
c7ff6e7a AK |
170 | typedef int cmp_return_type __attribute__((mode (__libgcc_cmp_return__))); |
171 | typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__))); | |
299b83b7 KG |
172 | |
173 | /* Make sure that we don't accidentally use any normal C language built-in | |
174 | type names in the first part of this file. Instead we want to use *only* | |
175 | the type names defined above. The following macro definitions insure | |
176 | that if we *do* accidentally use some normal C language built-in type name, | |
177 | we will get a syntax error. */ | |
178 | ||
179 | #define char bogus_type | |
180 | #define short bogus_type | |
181 | #define int bogus_type | |
182 | #define long bogus_type | |
183 | #define unsigned bogus_type | |
184 | #define float bogus_type | |
185 | #define double bogus_type | |
186 | ||
2ce182e2 JJ |
187 | #if (defined(__BITINT_MAXWIDTH__) \ |
188 | && (defined(L_mulbitint3) || defined(L_divmodbitint4))) | |
189 | #undef LIBGCC2_UNITS_PER_WORD | |
190 | #define LIBGCC2_UNITS_PER_WORD (__LIBGCC_BITINT_LIMB_WIDTH__ / __CHAR_BIT__) | |
191 | #endif | |
192 | ||
0aec6014 EB |
193 | /* Versions prior to 3.4.4 were not taking into account the word size for |
194 | the 5 trapping arithmetic functions absv, addv, subv, mulv and negv. As | |
195 | a consequence, the si and di variants were always and the only ones emitted. | |
196 | To maintain backward compatibility, COMPAT_SIMODE_TRAPPING_ARITHMETIC is | |
197 | defined on platforms where it makes sense to still have the si variants | |
198 | emitted. As a bonus, their implementation is now correct. Note that the | |
199 | same mechanism should have been implemented for the di variants, but it | |
200 | turns out that no platform would define COMPAT_DIMODE_TRAPPING_ARITHMETIC | |
201 | if it existed. */ | |
202 | ||
baffad1f | 203 | #if LIBGCC2_UNITS_PER_WORD == 8 |
a153644f | 204 | #define W_TYPE_SIZE (8 * __CHAR_BIT__) |
6da9c622 RK |
205 | #define Wtype DItype |
206 | #define UWtype UDItype | |
207 | #define HWtype DItype | |
208 | #define UHWtype UDItype | |
209 | #define DWtype TItype | |
210 | #define UDWtype UTItype | |
cdbf4541 BS |
211 | #ifdef LIBGCC2_GNU_PREFIX |
212 | #define __NW(a,b) __gnu_ ## a ## di ## b | |
213 | #define __NDW(a,b) __gnu_ ## a ## ti ## b | |
214 | #else | |
6da9c622 RK |
215 | #define __NW(a,b) __ ## a ## di ## b |
216 | #define __NDW(a,b) __ ## a ## ti ## b | |
cdbf4541 | 217 | #endif |
0aec6014 | 218 | #define COMPAT_SIMODE_TRAPPING_ARITHMETIC |
baffad1f | 219 | #elif LIBGCC2_UNITS_PER_WORD == 4 |
a153644f | 220 | #define W_TYPE_SIZE (4 * __CHAR_BIT__) |
299b83b7 KG |
221 | #define Wtype SItype |
222 | #define UWtype USItype | |
223 | #define HWtype SItype | |
224 | #define UHWtype USItype | |
225 | #define DWtype DItype | |
226 | #define UDWtype UDItype | |
cdbf4541 BS |
227 | #ifdef LIBGCC2_GNU_PREFIX |
228 | #define __NW(a,b) __gnu_ ## a ## si ## b | |
229 | #define __NDW(a,b) __gnu_ ## a ## di ## b | |
230 | #else | |
299b83b7 KG |
231 | #define __NW(a,b) __ ## a ## si ## b |
232 | #define __NDW(a,b) __ ## a ## di ## b | |
cdbf4541 | 233 | #endif |
baffad1f | 234 | #elif LIBGCC2_UNITS_PER_WORD == 2 |
a153644f | 235 | #define W_TYPE_SIZE (2 * __CHAR_BIT__) |
299b83b7 KG |
236 | #define Wtype HItype |
237 | #define UWtype UHItype | |
238 | #define HWtype HItype | |
239 | #define UHWtype UHItype | |
240 | #define DWtype SItype | |
241 | #define UDWtype USItype | |
cdbf4541 BS |
242 | #ifdef LIBGCC2_GNU_PREFIX |
243 | #define __NW(a,b) __gnu_ ## a ## hi ## b | |
244 | #define __NDW(a,b) __gnu_ ## a ## si ## b | |
245 | #else | |
299b83b7 KG |
246 | #define __NW(a,b) __ ## a ## hi ## b |
247 | #define __NDW(a,b) __ ## a ## si ## b | |
cdbf4541 | 248 | #endif |
299b83b7 | 249 | #else |
a153644f | 250 | #define W_TYPE_SIZE __CHAR_BIT__ |
299b83b7 KG |
251 | #define Wtype QItype |
252 | #define UWtype UQItype | |
253 | #define HWtype QItype | |
254 | #define UHWtype UQItype | |
255 | #define DWtype HItype | |
256 | #define UDWtype UHItype | |
cdbf4541 BS |
257 | #ifdef LIBGCC2_GNU_PREFIX |
258 | #define __NW(a,b) __gnu_ ## a ## qi ## b | |
259 | #define __NDW(a,b) __gnu_ ## a ## hi ## b | |
260 | #else | |
299b83b7 KG |
261 | #define __NW(a,b) __ ## a ## qi ## b |
262 | #define __NDW(a,b) __ ## a ## hi ## b | |
263 | #endif | |
cdbf4541 | 264 | #endif |
299b83b7 | 265 | |
cdbf4541 BS |
266 | #ifdef LIBGCC2_GNU_PREFIX |
267 | #define __N(a) __gnu_ ## a | |
268 | #else | |
269 | #define __N(a) __ ## a | |
270 | #endif | |
5d0e6486 AO |
271 | #define Wtype_MAX ((Wtype)(((UWtype)1 << (W_TYPE_SIZE - 1)) - 1)) |
272 | #define Wtype_MIN (- Wtype_MAX - 1) | |
273 | ||
4f2e0d5e RH |
274 | #if W_TYPE_SIZE == 8 |
275 | # define Wtype_MAXp1_F 0x1p8f | |
276 | #elif W_TYPE_SIZE == 16 | |
277 | # define Wtype_MAXp1_F 0x1p16f | |
278 | #elif W_TYPE_SIZE == 32 | |
279 | # define Wtype_MAXp1_F 0x1p32f | |
280 | #elif W_TYPE_SIZE == 64 | |
281 | # define Wtype_MAXp1_F 0x1p64f | |
282 | #else | |
283 | # error "expand the table" | |
284 | #endif | |
285 | ||
6da9c622 RK |
286 | #define __muldi3 __NDW(mul,3) |
287 | #define __divdi3 __NDW(div,3) | |
288 | #define __udivdi3 __NDW(udiv,3) | |
289 | #define __moddi3 __NDW(mod,3) | |
290 | #define __umoddi3 __NDW(umod,3) | |
291 | #define __negdi2 __NDW(neg,2) | |
292 | #define __lshrdi3 __NDW(lshr,3) | |
293 | #define __ashldi3 __NDW(ashl,3) | |
294 | #define __ashrdi3 __NDW(ashr,3) | |
6da9c622 RK |
295 | #define __cmpdi2 __NDW(cmp,2) |
296 | #define __ucmpdi2 __NDW(ucmp,2) | |
18362447 | 297 | #define __divmoddi4 __NDW(divmod,4) |
6da9c622 RK |
298 | #define __udivmoddi4 __NDW(udivmod,4) |
299 | #define __fixunstfDI __NDW(fixunstf,) | |
300 | #define __fixtfdi __NDW(fixtf,) | |
301 | #define __fixunsxfDI __NDW(fixunsxf,) | |
302 | #define __fixxfdi __NDW(fixxf,) | |
303 | #define __fixunsdfDI __NDW(fixunsdf,) | |
304 | #define __fixdfdi __NDW(fixdf,) | |
305 | #define __fixunssfDI __NDW(fixunssf,) | |
306 | #define __fixsfdi __NDW(fixsf,) | |
307 | #define __floatdixf __NDW(float,xf) | |
308 | #define __floatditf __NDW(float,tf) | |
309 | #define __floatdidf __NDW(float,df) | |
310 | #define __floatdisf __NDW(float,sf) | |
d7735880 JM |
311 | #define __floatundixf __NDW(floatun,xf) |
312 | #define __floatunditf __NDW(floatun,tf) | |
313 | #define __floatundidf __NDW(floatun,df) | |
314 | #define __floatundisf __NDW(floatun,sf) | |
6da9c622 RK |
315 | #define __fixunsxfSI __NW(fixunsxf,) |
316 | #define __fixunstfSI __NW(fixunstf,) | |
317 | #define __fixunsdfSI __NW(fixunsdf,) | |
318 | #define __fixunssfSI __NW(fixunssf,) | |
319 | ||
0aec6014 EB |
320 | #define __absvSI2 __NW(absv,2) |
321 | #define __addvSI3 __NW(addv,3) | |
322 | #define __subvSI3 __NW(subv,3) | |
323 | #define __mulvSI3 __NW(mulv,3) | |
324 | #define __negvSI2 __NW(negv,2) | |
325 | #define __absvDI2 __NDW(absv,2) | |
326 | #define __addvDI3 __NDW(addv,3) | |
327 | #define __subvDI3 __NDW(subv,3) | |
328 | #define __mulvDI3 __NDW(mulv,3) | |
329 | #define __negvDI2 __NDW(negv,2) | |
330 | ||
dfff898c | 331 | #define __ffsSI2 __NW(ffs,2) |
8275b011 RH |
332 | #define __clzSI2 __NW(clz,2) |
333 | #define __ctzSI2 __NW(ctz,2) | |
3801c801 | 334 | #define __clrsbSI2 __NW(clrsb,2) |
8275b011 RH |
335 | #define __popcountSI2 __NW(popcount,2) |
336 | #define __paritySI2 __NW(parity,2) | |
dfff898c | 337 | #define __ffsDI2 __NDW(ffs,2) |
8275b011 RH |
338 | #define __clzDI2 __NDW(clz,2) |
339 | #define __ctzDI2 __NDW(ctz,2) | |
3801c801 | 340 | #define __clrsbDI2 __NDW(clrsb,2) |
8275b011 RH |
341 | #define __popcountDI2 __NDW(popcount,2) |
342 | #define __parityDI2 __NDW(parity,2) | |
dfff898c | 343 | |
cdbf4541 | 344 | #define __clz_tab __N(clz_tab) |
0c007eb2 BS |
345 | #define __bswapsi2 __N(bswapsi2) |
346 | #define __bswapdi2 __N(bswapdi2) | |
347 | #define __udiv_w_sdiv __N(udiv_w_sdiv) | |
348 | #define __clear_cache __N(clear_cache) | |
349 | #define __enable_execute_stack __N(enable_execute_stack) | |
350 | ||
351 | #ifndef __powisf2 | |
cdbf4541 | 352 | #define __powisf2 __N(powisf2) |
0c007eb2 BS |
353 | #endif |
354 | #ifndef __powidf2 | |
cdbf4541 | 355 | #define __powidf2 __N(powidf2) |
0c007eb2 BS |
356 | #endif |
357 | #ifndef __powitf2 | |
cdbf4541 | 358 | #define __powitf2 __N(powitf2) |
0c007eb2 BS |
359 | #endif |
360 | #ifndef __powixf2 | |
cdbf4541 | 361 | #define __powixf2 __N(powixf2) |
0c007eb2 BS |
362 | #endif |
363 | #ifndef __mulsc3 | |
cdbf4541 | 364 | #define __mulsc3 __N(mulsc3) |
0c007eb2 BS |
365 | #endif |
366 | #ifndef __muldc3 | |
cdbf4541 | 367 | #define __muldc3 __N(muldc3) |
0c007eb2 BS |
368 | #endif |
369 | #ifndef __mulxc3 | |
cdbf4541 | 370 | #define __mulxc3 __N(mulxc3) |
0c007eb2 BS |
371 | #endif |
372 | #ifndef __multc3 | |
cdbf4541 | 373 | #define __multc3 __N(multc3) |
0c007eb2 BS |
374 | #endif |
375 | #ifndef __divsc3 | |
cdbf4541 | 376 | #define __divsc3 __N(divsc3) |
0c007eb2 BS |
377 | #endif |
378 | #ifndef __divdc3 | |
cdbf4541 | 379 | #define __divdc3 __N(divdc3) |
0c007eb2 BS |
380 | #endif |
381 | #ifndef __divxc3 | |
cdbf4541 | 382 | #define __divxc3 __N(divxc3) |
0c007eb2 BS |
383 | #endif |
384 | #ifndef __divtc3 | |
cdbf4541 | 385 | #define __divtc3 __N(divtc3) |
0c007eb2 | 386 | #endif |
cdbf4541 | 387 | |
d30d6e76 KG |
388 | extern DWtype __muldi3 (DWtype, DWtype); |
389 | extern DWtype __divdi3 (DWtype, DWtype); | |
390 | extern UDWtype __udivdi3 (UDWtype, UDWtype); | |
391 | extern UDWtype __umoddi3 (UDWtype, UDWtype); | |
392 | extern DWtype __moddi3 (DWtype, DWtype); | |
18362447 | 393 | extern DWtype __divmoddi4 (DWtype, DWtype, DWtype *); |
6da9c622 | 394 | |
d30d6e76 KG |
395 | /* __udivmoddi4 is static inline when building other libgcc2 portions. */ |
396 | #if (!defined (L_udivdi3) && !defined (L_divdi3) && \ | |
18362447 UB |
397 | !defined (L_umoddi3) && !defined (L_moddi3) && \ |
398 | !defined (L_divmoddi4)) | |
d30d6e76 KG |
399 | extern UDWtype __udivmoddi4 (UDWtype, UDWtype, UDWtype *); |
400 | #endif | |
401 | ||
2ce182e2 JJ |
402 | #if (defined(__BITINT_MAXWIDTH__) \ |
403 | && (defined(L_mulbitint3) || defined(L_divmodbitint4))) | |
404 | /* _BitInt support. */ | |
6dece991 JJ |
405 | typedef UWtype __attribute__((__may_alias__)) UBILtype; |
406 | extern void __mulbitint3 (UBILtype *, SItype, const UBILtype *, SItype, | |
407 | const UBILtype *, SItype); | |
408 | extern void __divmodbitint4 (UBILtype *, SItype, UBILtype *, SItype, | |
409 | const UBILtype *, SItype, const UBILtype *, | |
410 | SItype); | |
2ce182e2 JJ |
411 | #endif |
412 | ||
d30d6e76 KG |
413 | /* __negdi2 is static inline when building other libgcc2 portions. */ |
414 | #if !defined(L_divdi3) && !defined(L_moddi3) | |
415 | extern DWtype __negdi2 (DWtype); | |
416 | #endif | |
417 | ||
c7ff6e7a AK |
418 | extern DWtype __lshrdi3 (DWtype, shift_count_type); |
419 | extern DWtype __ashldi3 (DWtype, shift_count_type); | |
420 | extern DWtype __ashrdi3 (DWtype, shift_count_type); | |
2928cd7a | 421 | |
d30d6e76 KG |
422 | /* __udiv_w_sdiv is static inline when building other libgcc2 portions. */ |
423 | #if (!defined(L_udivdi3) && !defined(L_divdi3) && \ | |
424 | !defined(L_umoddi3) && !defined(L_moddi3)) | |
425 | extern UWtype __udiv_w_sdiv (UWtype *, UWtype, UWtype, UWtype); | |
426 | #endif | |
427 | ||
c7ff6e7a | 428 | extern cmp_return_type __cmpdi2 (DWtype, DWtype); |
ebc4cd54 | 429 | extern cmp_return_type __ucmpdi2 (UDWtype, UDWtype); |
d30d6e76 | 430 | |
66965e90 EC |
431 | #if MIN_UNITS_PER_WORD > 1 |
432 | extern SItype __bswapsi2 (SItype); | |
433 | #endif | |
4471aff6 | 434 | #if __SIZEOF_LONG_LONG__ > 4 |
66965e90 EC |
435 | extern DItype __bswapdi2 (DItype); |
436 | #endif | |
437 | ||
0aec6014 EB |
438 | extern Wtype __absvSI2 (Wtype); |
439 | extern Wtype __addvSI3 (Wtype, Wtype); | |
440 | extern Wtype __subvSI3 (Wtype, Wtype); | |
441 | extern Wtype __mulvSI3 (Wtype, Wtype); | |
442 | extern Wtype __negvSI2 (Wtype); | |
443 | extern DWtype __absvDI2 (DWtype); | |
444 | extern DWtype __addvDI3 (DWtype, DWtype); | |
445 | extern DWtype __subvDI3 (DWtype, DWtype); | |
446 | extern DWtype __mulvDI3 (DWtype, DWtype); | |
447 | extern DWtype __negvDI2 (DWtype); | |
448 | ||
449 | #ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC | |
cdbf4541 BS |
450 | #define __absvsi2 __N(absvsi2) |
451 | #define __negvsi2 __N(negvsi2) | |
452 | #define __addvsi3 __N(addvsi3) | |
453 | #define __subvsi3 __N(subvsi3) | |
454 | #define __mulvsi3 __N(mulvsi3) | |
455 | ||
0aec6014 EB |
456 | extern SItype __absvsi2 (SItype); |
457 | extern SItype __addvsi3 (SItype, SItype); | |
458 | extern SItype __subvsi3 (SItype, SItype); | |
459 | extern SItype __mulvsi3 (SItype, SItype); | |
460 | extern SItype __negvsi2 (SItype); | |
461 | #endif /* COMPAT_SIMODE_TRAPPING_ARITHMETIC */ | |
8f54374e | 462 | |
0b8495ae | 463 | #undef int |
0abcd6cc JG |
464 | #if LIBGCC2_HAS_HF_MODE |
465 | extern HCtype __divhc3 (HFtype, HFtype, HFtype, HFtype); | |
466 | extern HCtype __mulhc3 (HFtype, HFtype, HFtype, HFtype); | |
467 | #endif | |
cfa7bd9c | 468 | #if LIBGCC2_HAS_SF_MODE |
d30d6e76 | 469 | extern DWtype __fixsfdi (SFtype); |
d30d6e76 | 470 | extern SFtype __floatdisf (DWtype); |
d7735880 | 471 | extern SFtype __floatundisf (UDWtype); |
6da9c622 | 472 | extern UWtype __fixunssfSI (SFtype); |
f139f5fa | 473 | extern UDWtype __fixunssfDI (SFtype); |
0b8495ae | 474 | extern SFtype __powisf2 (SFtype, int); |
7e7e470f RH |
475 | extern SCtype __divsc3 (SFtype, SFtype, SFtype, SFtype); |
476 | extern SCtype __mulsc3 (SFtype, SFtype, SFtype, SFtype); | |
cfa7bd9c | 477 | #endif |
4e9db8b2 | 478 | #if LIBGCC2_HAS_DF_MODE |
4f2e0d5e RH |
479 | extern DWtype __fixdfdi (DFtype); |
480 | extern DFtype __floatdidf (DWtype); | |
d7735880 | 481 | extern DFtype __floatundidf (UDWtype); |
4f2e0d5e | 482 | extern UWtype __fixunsdfSI (DFtype); |
f139f5fa | 483 | extern UDWtype __fixunsdfDI (DFtype); |
0b8495ae | 484 | extern DFtype __powidf2 (DFtype, int); |
7e7e470f RH |
485 | extern DCtype __divdc3 (DFtype, DFtype, DFtype, DFtype); |
486 | extern DCtype __muldc3 (DFtype, DFtype, DFtype, DFtype); | |
4f2e0d5e | 487 | #endif |
7e7e470f | 488 | |
4e9db8b2 | 489 | #if LIBGCC2_HAS_XF_MODE |
d30d6e76 | 490 | extern DWtype __fixxfdi (XFtype); |
f139f5fa | 491 | extern UDWtype __fixunsxfDI (XFtype); |
d30d6e76 | 492 | extern XFtype __floatdixf (DWtype); |
d7735880 | 493 | extern XFtype __floatundixf (UDWtype); |
6da9c622 | 494 | extern UWtype __fixunsxfSI (XFtype); |
0b8495ae | 495 | extern XFtype __powixf2 (XFtype, int); |
7e7e470f RH |
496 | extern XCtype __divxc3 (XFtype, XFtype, XFtype, XFtype); |
497 | extern XCtype __mulxc3 (XFtype, XFtype, XFtype, XFtype); | |
d30d6e76 KG |
498 | #endif |
499 | ||
4e9db8b2 | 500 | #if LIBGCC2_HAS_TF_MODE |
f139f5fa | 501 | extern UDWtype __fixunstfDI (TFtype); |
d30d6e76 KG |
502 | extern DWtype __fixtfdi (TFtype); |
503 | extern TFtype __floatditf (DWtype); | |
d7735880 | 504 | extern TFtype __floatunditf (UDWtype); |
0b8495ae | 505 | extern TFtype __powitf2 (TFtype, int); |
7e7e470f RH |
506 | extern TCtype __divtc3 (TFtype, TFtype, TFtype, TFtype); |
507 | extern TCtype __multc3 (TFtype, TFtype, TFtype, TFtype); | |
d30d6e76 | 508 | #endif |
0b8495ae | 509 | #define int bogus_type |
d30d6e76 | 510 | |
299b83b7 | 511 | /* DWstructs are pairs of Wtype values in the order determined by |
18ed6ee4 | 512 | __BYTE_ORDER__. */ |
299b83b7 | 513 | |
18ed6ee4 | 514 | #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ |
299b83b7 KG |
515 | struct DWstruct {Wtype high, low;}; |
516 | #else | |
517 | struct DWstruct {Wtype low, high;}; | |
518 | #endif | |
519 | ||
520 | /* We need this union to unpack/pack DImode values, since we don't have | |
521 | any arithmetic yet. Incoming DImode parameters are stored into the | |
522 | `ll' field, and the unpacked result is read from the struct `s'. */ | |
523 | ||
524 | typedef union | |
525 | { | |
526 | struct DWstruct s; | |
527 | DWtype ll; | |
528 | } DWunion; | |
529 | ||
dcfae47c NC |
530 | /* Defined for L_popcount_tab. Exported here because some targets may |
531 | want to use it for their own versions of the __popcount builtins. */ | |
532 | extern const UQItype __popcount_tab[256]; | |
533 | ||
534 | /* Defined for L_clz. Exported here because some targets may want to use | |
535 | it for their own versions of the __clz builtins. It contains the bit | |
536 | position of the first set bit for the numbers 0 - 255. This avoids the | |
6fc0bb99 | 537 | need for a separate table for the __ctz builtins. */ |
dcfae47c NC |
538 | extern const UQItype __clz_tab[256]; |
539 | ||
299b83b7 KG |
540 | #include "longlong.h" |
541 | ||
3fc1f660 MM |
542 | #undef int |
543 | extern int __clzDI2 (UDWtype); | |
544 | extern int __clzSI2 (UWtype); | |
545 | extern int __ctzSI2 (UWtype); | |
3801c801 BS |
546 | extern int __ctzDI2 (UDWtype); |
547 | extern int __clrsbSI2 (Wtype); | |
548 | extern int __clrsbDI2 (DWtype); | |
3fc1f660 MM |
549 | extern int __ffsSI2 (UWtype); |
550 | extern int __ffsDI2 (DWtype); | |
3fc1f660 MM |
551 | extern int __popcountSI2 (UWtype); |
552 | extern int __popcountDI2 (UDWtype); | |
553 | extern int __paritySI2 (UWtype); | |
554 | extern int __parityDI2 (UDWtype); | |
555 | #define int bogus_type | |
556 | ||
557 | extern void __enable_execute_stack (void *); | |
558 | ||
f0a90c7d AO |
559 | extern void __strub_enter (void **); |
560 | extern void __strub_update (void**); | |
561 | extern void __strub_leave (void **); | |
562 | ||
7370bebd | 563 | #ifndef HIDE_EXPORTS |
3fc1f660 | 564 | #pragma GCC visibility pop |
7370bebd | 565 | #endif |
3fc1f660 | 566 | |
88657302 | 567 | #endif /* ! GCC_LIBGCC2_H */ |