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