190075Sobrien/* Header file for libgcc2.c.  */
2169689Skan/* Copyright (C) 2000, 2001, 2004, 2005
390075Sobrien   Free Software Foundation, Inc.
490075Sobrien
590075SobrienThis file is part of GCC.
690075Sobrien
790075SobrienGCC is free software; you can redistribute it and/or modify it under
890075Sobrienthe terms of the GNU General Public License as published by the Free
990075SobrienSoftware Foundation; either version 2, or (at your option) any later
1090075Sobrienversion.
1190075Sobrien
1290075SobrienGCC is distributed in the hope that it will be useful, but WITHOUT ANY
1390075SobrienWARRANTY; without even the implied warranty of MERCHANTABILITY or
1490075SobrienFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1590075Sobrienfor more details.
1690075Sobrien
1790075SobrienYou should have received a copy of the GNU General Public License
1890075Sobrienalong with GCC; see the file COPYING.  If not, write to the Free
19169689SkanSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20169689Skan02110-1301, USA.  */
2190075Sobrien
22117395Skan/* As a special exception, if you link this library with other files,
23117395Skan   some of which are compiled with GCC, to produce an executable,
24117395Skan   this library does not by itself cause the resulting executable
25117395Skan   to be covered by the GNU General Public License.
26117395Skan   This exception does not however invalidate any other reasons why
27117395Skan   the executable file might be covered by the GNU General Public License.  */
28117395Skan
29117395Skan
3090075Sobrien#ifndef GCC_LIBGCC2_H
3190075Sobrien#define GCC_LIBGCC2_H
3290075Sobrien
33169689Skan#ifndef HIDE_EXPORTS
34169689Skan#pragma GCC visibility push(default)
35169689Skan#endif
36169689Skan
3790075Sobrienextern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t);
3890075Sobrienextern void __clear_cache (char *, char *);
3990075Sobrienextern void __eprintf (const char *, const char *, unsigned int, const char *)
4090075Sobrien  __attribute__ ((__noreturn__));
4190075Sobrien
4290075Sobrienstruct exception_descriptor;
4390075Sobrienextern short int __get_eh_table_language (struct exception_descriptor *);
4490075Sobrienextern short int __get_eh_table_version (struct exception_descriptor *);
4590075Sobrien
4690075Sobrien/* Permit the tm.h file to select the endianness to use just for this
4790075Sobrien   file.  This is used when the endianness is determined when the
4890075Sobrien   compiler is run.  */
4990075Sobrien
5090075Sobrien#ifndef LIBGCC2_WORDS_BIG_ENDIAN
5190075Sobrien#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
5290075Sobrien#endif
5390075Sobrien
54169689Skan#ifndef LIBGCC2_DOUBLE_TYPE_SIZE
55169689Skan#define LIBGCC2_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE
56169689Skan#endif
5790075Sobrien#ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
5890075Sobrien#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE
5990075Sobrien#endif
6090075Sobrien
61169689Skan#ifndef LIBGCC2_HAS_SF_MODE
62169689Skan#define LIBGCC2_HAS_SF_MODE (BITS_PER_UNIT == 8)
6390075Sobrien#endif
6490075Sobrien
65169689Skan#ifndef LIBGCC2_HAS_DF_MODE
66169689Skan#define LIBGCC2_HAS_DF_MODE \
67169689Skan  (BITS_PER_UNIT == 8 \
68169689Skan   && (LIBGCC2_DOUBLE_TYPE_SIZE == 64 \
69169689Skan       || LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 64))
70169689Skan#endif
71169689Skan
72169689Skan#ifndef LIBGCC2_HAS_XF_MODE
73169689Skan#define LIBGCC2_HAS_XF_MODE \
74169689Skan  (BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80)
75169689Skan#endif
76169689Skan
77169689Skan#ifndef LIBGCC2_HAS_TF_MODE
78169689Skan#define LIBGCC2_HAS_TF_MODE \
79169689Skan  (BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128)
80169689Skan#endif
81169689Skan
82169689Skan#ifndef SF_SIZE
83169689Skan#if LIBGCC2_HAS_SF_MODE
84169689Skan#define SF_SIZE FLT_MANT_DIG
85169689Skan#else
86169689Skan#define SF_SIZE 0
87169689Skan#endif
88169689Skan#endif
89169689Skan
90169689Skan#ifndef DF_SIZE
91169689Skan#if LIBGCC2_HAS_DF_MODE
92169689Skan#if LIBGCC2_DOUBLE_TYPE_SIZE == 64
93169689Skan#define DF_SIZE DBL_MANT_DIG
94169689Skan#elif LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 64
95169689Skan#define DF_SIZE LDBL_MANT_DIG
96169689Skan#else
97169689Skan#define DF_SIZE 0
98169689Skan#endif
99169689Skan#else
100169689Skan#define DF_SIZE 0
101169689Skan#endif
102169689Skan#endif
103169689Skan
104169689Skan#ifndef XF_SIZE
105169689Skan#if LIBGCC2_HAS_XF_MODE
106169689Skan#define XF_SIZE LDBL_MANT_DIG
107169689Skan#else
108169689Skan#define XF_SIZE 0
109169689Skan#endif
110169689Skan#endif
111169689Skan
112169689Skan#ifndef TF_SIZE
113169689Skan#if LIBGCC2_HAS_TF_MODE
114169689Skan#define TF_SIZE LDBL_MANT_DIG
115169689Skan#else
116169689Skan#define TF_SIZE 0
117169689Skan#endif
118169689Skan#endif
119169689Skan
120169689Skan/* FIXME: This #ifdef probably should be removed, ie. enable the test
121169689Skan   for mips too.  */
122169689Skan#ifdef __powerpc__
123169689Skan#define IS_IBM_EXTENDED(SIZE) (SIZE == 106)
124169689Skan#else
125169689Skan#define IS_IBM_EXTENDED(SIZE) 0
126169689Skan#endif
127169689Skan
12890075Sobrien/* In the first part of this file, we are interfacing to calls generated
12990075Sobrien   by the compiler itself.  These calls pass values into these routines
13090075Sobrien   which have very specific modes (rather than very specific types), and
13190075Sobrien   these compiler-generated calls also expect any return values to have
13290075Sobrien   very specific modes (rather than very specific types).  Thus, we need
13390075Sobrien   to avoid using regular C language type names in this part of the file
13490075Sobrien   because the sizes for those types can be configured to be anything.
13590075Sobrien   Instead we use the following special type names.  */
13690075Sobrien
13790075Sobrientypedef		 int QItype	__attribute__ ((mode (QI)));
13890075Sobrientypedef unsigned int UQItype	__attribute__ ((mode (QI)));
13990075Sobrientypedef		 int HItype	__attribute__ ((mode (HI)));
14090075Sobrientypedef unsigned int UHItype	__attribute__ ((mode (HI)));
14190075Sobrien#if MIN_UNITS_PER_WORD > 1
142132718Skan/* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1.  */
14390075Sobrientypedef 	 int SItype	__attribute__ ((mode (SI)));
14490075Sobrientypedef unsigned int USItype	__attribute__ ((mode (SI)));
14590075Sobrien#if LONG_LONG_TYPE_SIZE > 32
146132718Skan/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2.  */
14790075Sobrientypedef		 int DItype	__attribute__ ((mode (DI)));
14890075Sobrientypedef unsigned int UDItype	__attribute__ ((mode (DI)));
14990075Sobrien#if MIN_UNITS_PER_WORD > 4
150132718Skan/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4.  */
15190075Sobrientypedef		 int TItype	__attribute__ ((mode (TI)));
15290075Sobrientypedef unsigned int UTItype	__attribute__ ((mode (TI)));
15390075Sobrien#endif
15490075Sobrien#endif
15590075Sobrien#endif
15690075Sobrien
157169689Skan#if LIBGCC2_HAS_SF_MODE
15890075Sobrientypedef 	float SFtype	__attribute__ ((mode (SF)));
159169689Skantypedef _Complex float SCtype	__attribute__ ((mode (SC)));
160169689Skan#endif
161169689Skan#if LIBGCC2_HAS_DF_MODE
16290075Sobrientypedef		float DFtype	__attribute__ ((mode (DF)));
163169689Skantypedef _Complex float DCtype	__attribute__ ((mode (DC)));
164169689Skan#endif
165169689Skan#if LIBGCC2_HAS_XF_MODE
16690075Sobrientypedef		float XFtype	__attribute__ ((mode (XF)));
167169689Skantypedef _Complex float XCtype	__attribute__ ((mode (XC)));
16890075Sobrien#endif
169169689Skan#if LIBGCC2_HAS_TF_MODE
17090075Sobrientypedef		float TFtype	__attribute__ ((mode (TF)));
171169689Skantypedef _Complex float TCtype	__attribute__ ((mode (TC)));
17290075Sobrien#endif
17390075Sobrien
17490075Sobrientypedef int word_type __attribute__ ((mode (__word__)));
17590075Sobrien
17690075Sobrien/* Make sure that we don't accidentally use any normal C language built-in
17790075Sobrien   type names in the first part of this file.  Instead we want to use *only*
17890075Sobrien   the type names defined above.  The following macro definitions insure
17990075Sobrien   that if we *do* accidentally use some normal C language built-in type name,
18090075Sobrien   we will get a syntax error.  */
18190075Sobrien
18290075Sobrien#define char bogus_type
18390075Sobrien#define short bogus_type
18490075Sobrien#define int bogus_type
18590075Sobrien#define long bogus_type
18690075Sobrien#define unsigned bogus_type
18790075Sobrien#define float bogus_type
18890075Sobrien#define double bogus_type
18990075Sobrien
190146895Skan/* Versions prior to 3.4.4 were not taking into account the word size for
191146895Skan   the 5 trapping arithmetic functions absv, addv, subv, mulv and negv.  As
192146895Skan   a consequence, the si and di variants were always and the only ones emitted.
193146895Skan   To maintain backward compatibility, COMPAT_SIMODE_TRAPPING_ARITHMETIC is
194146895Skan   defined on platforms where it makes sense to still have the si variants
195146895Skan   emitted.  As a bonus, their implementation is now correct.  Note that the
196146895Skan   same mechanism should have been implemented for the di variants, but it
197146895Skan   turns out that no platform would define COMPAT_DIMODE_TRAPPING_ARITHMETIC
198146895Skan   if it existed.  */
199146895Skan
200169689Skan#if LIBGCC2_UNITS_PER_WORD == 8
20190075Sobrien#define W_TYPE_SIZE (8 * BITS_PER_UNIT)
20290075Sobrien#define Wtype	DItype
20390075Sobrien#define UWtype	UDItype
20490075Sobrien#define HWtype	DItype
20590075Sobrien#define UHWtype	UDItype
20690075Sobrien#define DWtype	TItype
20790075Sobrien#define UDWtype	UTItype
20890075Sobrien#define __NW(a,b)	__ ## a ## di ## b
20990075Sobrien#define __NDW(a,b)	__ ## a ## ti ## b
210146895Skan#define COMPAT_SIMODE_TRAPPING_ARITHMETIC
211169689Skan#elif LIBGCC2_UNITS_PER_WORD == 4
21290075Sobrien#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
21390075Sobrien#define Wtype	SItype
21490075Sobrien#define UWtype	USItype
21590075Sobrien#define HWtype	SItype
21690075Sobrien#define UHWtype	USItype
21790075Sobrien#define DWtype	DItype
21890075Sobrien#define UDWtype	UDItype
21990075Sobrien#define __NW(a,b)	__ ## a ## si ## b
22090075Sobrien#define __NDW(a,b)	__ ## a ## di ## b
221169689Skan#elif LIBGCC2_UNITS_PER_WORD == 2
22290075Sobrien#define W_TYPE_SIZE (2 * BITS_PER_UNIT)
22390075Sobrien#define Wtype	HItype
22490075Sobrien#define UWtype	UHItype
22590075Sobrien#define HWtype	HItype
22690075Sobrien#define UHWtype	UHItype
22790075Sobrien#define DWtype	SItype
22890075Sobrien#define UDWtype	USItype
22990075Sobrien#define __NW(a,b)	__ ## a ## hi ## b
23090075Sobrien#define __NDW(a,b)	__ ## a ## si ## b
23190075Sobrien#else
23290075Sobrien#define W_TYPE_SIZE BITS_PER_UNIT
23390075Sobrien#define Wtype	QItype
23490075Sobrien#define UWtype  UQItype
23590075Sobrien#define HWtype	QItype
23690075Sobrien#define UHWtype	UQItype
23790075Sobrien#define DWtype	HItype
23890075Sobrien#define UDWtype	UHItype
23990075Sobrien#define __NW(a,b)	__ ## a ## qi ## b
24090075Sobrien#define __NDW(a,b)	__ ## a ## hi ## b
24190075Sobrien#endif
24290075Sobrien
24390075Sobrien#define Wtype_MAX ((Wtype)(((UWtype)1 << (W_TYPE_SIZE - 1)) - 1))
24490075Sobrien#define Wtype_MIN (- Wtype_MAX - 1)
24590075Sobrien
246169689Skan#if W_TYPE_SIZE == 8
247169689Skan# define Wtype_MAXp1_F	0x1p8f
248169689Skan#elif W_TYPE_SIZE == 16
249169689Skan# define Wtype_MAXp1_F	0x1p16f
250169689Skan#elif W_TYPE_SIZE == 32
251169689Skan# define Wtype_MAXp1_F	0x1p32f
252169689Skan#elif W_TYPE_SIZE == 64
253169689Skan# define Wtype_MAXp1_F	0x1p64f
254169689Skan#else
255169689Skan# error "expand the table"
256169689Skan#endif
257169689Skan
25890075Sobrien#define __muldi3	__NDW(mul,3)
25990075Sobrien#define __divdi3	__NDW(div,3)
26090075Sobrien#define __udivdi3	__NDW(udiv,3)
26190075Sobrien#define __moddi3	__NDW(mod,3)
26290075Sobrien#define __umoddi3	__NDW(umod,3)
26390075Sobrien#define __negdi2	__NDW(neg,2)
26490075Sobrien#define __lshrdi3	__NDW(lshr,3)
26590075Sobrien#define __ashldi3	__NDW(ashl,3)
26690075Sobrien#define __ashrdi3	__NDW(ashr,3)
26790075Sobrien#define __cmpdi2	__NDW(cmp,2)
26890075Sobrien#define __ucmpdi2	__NDW(ucmp,2)
26990075Sobrien#define __udivmoddi4	__NDW(udivmod,4)
27090075Sobrien#define __fixunstfDI	__NDW(fixunstf,)
27190075Sobrien#define __fixtfdi	__NDW(fixtf,)
27290075Sobrien#define __fixunsxfDI	__NDW(fixunsxf,)
27390075Sobrien#define __fixxfdi	__NDW(fixxf,)
27490075Sobrien#define __fixunsdfDI	__NDW(fixunsdf,)
27590075Sobrien#define __fixdfdi	__NDW(fixdf,)
27690075Sobrien#define __fixunssfDI	__NDW(fixunssf,)
27790075Sobrien#define __fixsfdi	__NDW(fixsf,)
27890075Sobrien#define __floatdixf	__NDW(float,xf)
27990075Sobrien#define __floatditf	__NDW(float,tf)
28090075Sobrien#define __floatdidf	__NDW(float,df)
28190075Sobrien#define __floatdisf	__NDW(float,sf)
282169689Skan#define __floatundixf	__NDW(floatun,xf)
283169689Skan#define __floatunditf	__NDW(floatun,tf)
284169689Skan#define __floatundidf	__NDW(floatun,df)
285169689Skan#define __floatundisf	__NDW(floatun,sf)
28690075Sobrien#define __fixunsxfSI	__NW(fixunsxf,)
28790075Sobrien#define __fixunstfSI	__NW(fixunstf,)
28890075Sobrien#define __fixunsdfSI	__NW(fixunsdf,)
28990075Sobrien#define __fixunssfSI	__NW(fixunssf,)
29090075Sobrien
291146895Skan#define __absvSI2	__NW(absv,2)
292146895Skan#define __addvSI3	__NW(addv,3)
293146895Skan#define __subvSI3	__NW(subv,3)
294146895Skan#define __mulvSI3	__NW(mulv,3)
295146895Skan#define __negvSI2	__NW(negv,2)
296146895Skan#define __absvDI2	__NDW(absv,2)
297146895Skan#define __addvDI3	__NDW(addv,3)
298146895Skan#define __subvDI3	__NDW(subv,3)
299146895Skan#define __mulvDI3	__NDW(mulv,3)
300146895Skan#define __negvDI2	__NDW(negv,2)
301146895Skan
302132718Skan#define __ffsSI2	__NW(ffs,2)
303132718Skan#define __clzSI2	__NW(clz,2)
304132718Skan#define __ctzSI2	__NW(ctz,2)
305132718Skan#define __popcountSI2	__NW(popcount,2)
306132718Skan#define __paritySI2	__NW(parity,2)
307132718Skan#define __ffsDI2	__NDW(ffs,2)
308132718Skan#define __clzDI2	__NDW(clz,2)
309132718Skan#define __ctzDI2	__NDW(ctz,2)
310132718Skan#define __popcountDI2	__NDW(popcount,2)
311132718Skan#define __parityDI2	__NDW(parity,2)
312132718Skan
31390075Sobrienextern DWtype __muldi3 (DWtype, DWtype);
31490075Sobrienextern DWtype __divdi3 (DWtype, DWtype);
31590075Sobrienextern UDWtype __udivdi3 (UDWtype, UDWtype);
31690075Sobrienextern UDWtype __umoddi3 (UDWtype, UDWtype);
31790075Sobrienextern DWtype __moddi3 (DWtype, DWtype);
31890075Sobrien
31990075Sobrien/* __udivmoddi4 is static inline when building other libgcc2 portions.  */
32090075Sobrien#if (!defined (L_udivdi3) && !defined (L_divdi3) && \
32190075Sobrien     !defined (L_umoddi3) && !defined (L_moddi3))
32290075Sobrienextern UDWtype __udivmoddi4 (UDWtype, UDWtype, UDWtype *);
32390075Sobrien#endif
32490075Sobrien
32590075Sobrien/* __negdi2 is static inline when building other libgcc2 portions.  */
32690075Sobrien#if !defined(L_divdi3) && !defined(L_moddi3)
32790075Sobrienextern DWtype __negdi2 (DWtype);
32890075Sobrien#endif
32990075Sobrien
33090075Sobrienextern DWtype __lshrdi3 (DWtype, word_type);
33190075Sobrienextern DWtype __ashldi3 (DWtype, word_type);
33290075Sobrienextern DWtype __ashrdi3 (DWtype, word_type);
33390075Sobrien
33490075Sobrien/* __udiv_w_sdiv is static inline when building other libgcc2 portions.  */
33590075Sobrien#if (!defined(L_udivdi3) && !defined(L_divdi3) && \
33690075Sobrien     !defined(L_umoddi3) && !defined(L_moddi3))
33790075Sobrienextern UWtype __udiv_w_sdiv (UWtype *, UWtype, UWtype, UWtype);
33890075Sobrien#endif
33990075Sobrien
34090075Sobrienextern word_type __cmpdi2 (DWtype, DWtype);
34190075Sobrienextern word_type __ucmpdi2 (DWtype, DWtype);
34290075Sobrien
343146895Skanextern Wtype __absvSI2 (Wtype);
344146895Skanextern Wtype __addvSI3 (Wtype, Wtype);
345146895Skanextern Wtype __subvSI3 (Wtype, Wtype);
346146895Skanextern Wtype __mulvSI3 (Wtype, Wtype);
347146895Skanextern Wtype __negvSI2 (Wtype);
348146895Skanextern DWtype __absvDI2 (DWtype);
349146895Skanextern DWtype __addvDI3 (DWtype, DWtype);
350146895Skanextern DWtype __subvDI3 (DWtype, DWtype);
351146895Skanextern DWtype __mulvDI3 (DWtype, DWtype);
352146895Skanextern DWtype __negvDI2 (DWtype);
35390075Sobrien
354146895Skan#ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
355146895Skanextern SItype __absvsi2 (SItype);
356146895Skanextern SItype __addvsi3 (SItype, SItype);
357146895Skanextern SItype __subvsi3 (SItype, SItype);
358146895Skanextern SItype __mulvsi3 (SItype, SItype);
359146895Skanextern SItype __negvsi2 (SItype);
360146895Skan#endif /* COMPAT_SIMODE_TRAPPING_ARITHMETIC */
361146895Skan
362169689Skan#undef int
363169689Skan#if LIBGCC2_HAS_SF_MODE
364169689Skanextern DWtype __fixsfdi (SFtype);
365169689Skanextern SFtype __floatdisf (DWtype);
366169689Skanextern SFtype __floatundisf (UDWtype);
367169689Skanextern UWtype __fixunssfSI (SFtype);
368169689Skanextern DWtype __fixunssfDI (SFtype);
369169689Skanextern SFtype __powisf2 (SFtype, int);
370169689Skanextern SCtype __divsc3 (SFtype, SFtype, SFtype, SFtype);
371169689Skanextern SCtype __mulsc3 (SFtype, SFtype, SFtype, SFtype);
372169689Skan#endif
373169689Skan#if LIBGCC2_HAS_DF_MODE
37490075Sobrienextern DWtype __fixdfdi (DFtype);
37590075Sobrienextern DFtype __floatdidf (DWtype);
376169689Skanextern DFtype __floatundidf (UDWtype);
37790075Sobrienextern UWtype __fixunsdfSI (DFtype);
37890075Sobrienextern DWtype __fixunsdfDI (DFtype);
379169689Skanextern DFtype __powidf2 (DFtype, int);
380169689Skanextern DCtype __divdc3 (DFtype, DFtype, DFtype, DFtype);
381169689Skanextern DCtype __muldc3 (DFtype, DFtype, DFtype, DFtype);
382169689Skan#endif
38390075Sobrien
384169689Skan#if LIBGCC2_HAS_XF_MODE
38590075Sobrienextern DWtype __fixxfdi (XFtype);
38690075Sobrienextern DWtype __fixunsxfDI (XFtype);
38790075Sobrienextern XFtype __floatdixf (DWtype);
388169689Skanextern XFtype __floatundixf (UDWtype);
38990075Sobrienextern UWtype __fixunsxfSI (XFtype);
390169689Skanextern XFtype __powixf2 (XFtype, int);
391169689Skanextern XCtype __divxc3 (XFtype, XFtype, XFtype, XFtype);
392169689Skanextern XCtype __mulxc3 (XFtype, XFtype, XFtype, XFtype);
39390075Sobrien#endif
39490075Sobrien
395169689Skan#if LIBGCC2_HAS_TF_MODE
39690075Sobrienextern DWtype __fixunstfDI (TFtype);
39790075Sobrienextern DWtype __fixtfdi (TFtype);
39890075Sobrienextern TFtype __floatditf (DWtype);
399169689Skanextern TFtype __floatunditf (UDWtype);
400169689Skanextern TFtype __powitf2 (TFtype, int);
401169689Skanextern TCtype __divtc3 (TFtype, TFtype, TFtype, TFtype);
402169689Skanextern TCtype __multc3 (TFtype, TFtype, TFtype, TFtype);
40390075Sobrien#endif
404169689Skan#define int bogus_type
40590075Sobrien
40690075Sobrien/* DWstructs are pairs of Wtype values in the order determined by
40790075Sobrien   LIBGCC2_WORDS_BIG_ENDIAN.  */
40890075Sobrien
40990075Sobrien#if LIBGCC2_WORDS_BIG_ENDIAN
41090075Sobrien  struct DWstruct {Wtype high, low;};
41190075Sobrien#else
41290075Sobrien  struct DWstruct {Wtype low, high;};
41390075Sobrien#endif
41490075Sobrien
41590075Sobrien/* We need this union to unpack/pack DImode values, since we don't have
41690075Sobrien   any arithmetic yet.  Incoming DImode parameters are stored into the
41790075Sobrien   `ll' field, and the unpacked result is read from the struct `s'.  */
41890075Sobrien
41990075Sobrientypedef union
42090075Sobrien{
42190075Sobrien  struct DWstruct s;
42290075Sobrien  DWtype ll;
42390075Sobrien} DWunion;
42490075Sobrien
425169689Skan/* Defined for L_popcount_tab.  Exported here because some targets may
426169689Skan   want to use it for their own versions of the __popcount builtins.  */
427169689Skanextern const UQItype __popcount_tab[256];
428169689Skan
429169689Skan/* Defined for L_clz.  Exported here because some targets may want to use
430169689Skan   it for their own versions of the __clz builtins.  It contains the bit
431169689Skan   position of the first set bit for the numbers 0 - 255.  This avoids the
432169689Skan   need for a separate table for the __ctz builtins.  */
433169689Skanextern const UQItype __clz_tab[256];
434169689Skan
43590075Sobrien#include "longlong.h"
43690075Sobrien
437169689Skan#undef int
438169689Skanextern int __clzDI2 (UDWtype);
439169689Skanextern int __clzSI2 (UWtype);
440169689Skanextern int __ctzSI2 (UWtype);
441169689Skanextern int __ffsSI2 (UWtype);
442169689Skanextern int __ffsDI2 (DWtype);
443169689Skanextern int __ctzDI2 (UDWtype);
444169689Skanextern int __popcountSI2 (UWtype);
445169689Skanextern int __popcountDI2 (UDWtype);
446169689Skanextern int __paritySI2 (UWtype);
447169689Skanextern int __parityDI2 (UDWtype);
448169689Skan#define int bogus_type
449169689Skan
450169689Skanextern void __enable_execute_stack (void *);
451169689Skan
452169689Skan#ifndef HIDE_EXPORTS
453169689Skan#pragma GCC visibility pop
454169689Skan#endif
455169689Skan
45690075Sobrien#endif /* ! GCC_LIBGCC2_H */
457