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