]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/libgcc2.h
PrintJobAttribute.java, [...]: New files.
[thirdparty/gcc.git] / gcc / libgcc2.h
CommitLineData
299b83b7 1/* Header file for libgcc2.c. */
5d0e6486 2/* Copyright (C) 2000, 2001
299b83b7
KG
3 Free Software Foundation, Inc.
4
1322177d 5This file is part of GCC.
299b83b7 6
1322177d
LB
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 2, or (at your option) any later
10version.
299b83b7 11
1322177d
LB
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
299b83b7
KG
16
17You should have received a copy of the GNU General Public License
1322177d
LB
18along with GCC; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA
2002111-1307, USA. */
299b83b7 21
77c915d8
DT
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License. */
28
29
88657302
RH
30#ifndef GCC_LIBGCC2_H
31#define GCC_LIBGCC2_H
299b83b7
KG
32
33extern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t);
299b83b7 34extern void __clear_cache (char *, char *);
3fe68d0a
ZW
35extern void __eprintf (const char *, const char *, unsigned int, const char *)
36 __attribute__ ((__noreturn__));
299b83b7 37
299b83b7
KG
38struct exception_descriptor;
39extern short int __get_eh_table_language (struct exception_descriptor *);
40extern short int __get_eh_table_version (struct exception_descriptor *);
41
42/* Permit the tm.h file to select the endianness to use just for this
43 file. This is used when the endianness is determined when the
44 compiler is run. */
45
46#ifndef LIBGCC2_WORDS_BIG_ENDIAN
47#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
48#endif
49
50#ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
51#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE
52#endif
53
32b32c8f
JJ
54#ifndef MIN_UNITS_PER_WORD
55#define MIN_UNITS_PER_WORD UNITS_PER_WORD
56#endif
57
299b83b7
KG
58/* In the first part of this file, we are interfacing to calls generated
59 by the compiler itself. These calls pass values into these routines
60 which have very specific modes (rather than very specific types), and
61 these compiler-generated calls also expect any return values to have
62 very specific modes (rather than very specific types). Thus, we need
63 to avoid using regular C language type names in this part of the file
64 because the sizes for those types can be configured to be anything.
65 Instead we use the following special type names. */
66
67typedef int QItype __attribute__ ((mode (QI)));
68typedef unsigned int UQItype __attribute__ ((mode (QI)));
69typedef int HItype __attribute__ ((mode (HI)));
70typedef unsigned int UHItype __attribute__ ((mode (HI)));
aa63d244 71#if MIN_UNITS_PER_WORD > 1
299b83b7
KG
72/* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1 */
73typedef int SItype __attribute__ ((mode (SI)));
74typedef unsigned int USItype __attribute__ ((mode (SI)));
a746dbf5 75#if LONG_LONG_TYPE_SIZE > 32
299b83b7
KG
76/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2 */
77typedef int DItype __attribute__ ((mode (DI)));
78typedef unsigned int UDItype __attribute__ ((mode (DI)));
6da9c622
RK
79#if MIN_UNITS_PER_WORD > 4
80/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4 */
81typedef int TItype __attribute__ ((mode (TI)));
82typedef unsigned int UTItype __attribute__ ((mode (TI)));
83#endif
299b83b7
KG
84#endif
85#endif
86
87#if BITS_PER_UNIT == 8
88
89typedef float SFtype __attribute__ ((mode (SF)));
90typedef float DFtype __attribute__ ((mode (DF)));
91
92#if LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 96
93typedef float XFtype __attribute__ ((mode (XF)));
94#endif
95#if LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128
96typedef float TFtype __attribute__ ((mode (TF)));
97#endif
98
99#else /* BITS_PER_UNIT != 8 */
100
101/* On dsp's there are usually qf/hf/tqf modes used instead of the above.
102 For now we don't support them in libgcc2.c. */
103
104#undef L_fixdfdi
105#undef L_fixsfdi
106#undef L_fixtfdi
107#undef L_fixunsdfdi
108#undef L_fixunsdfsi
109#undef L_fixunssfdi
110#undef L_fixunssfsi
111#undef L_fixunstfdi
112#undef L_fixunsxfdi
113#undef L_fixunsxfsi
114#undef L_fixxfdi
115#undef L_floatdidf
116#undef L_floatdisf
117#undef L_floatditf
118#undef L_floatdixf
119
120#endif /* BITS_PER_UNIT != 8 */
121
122typedef int word_type __attribute__ ((mode (__word__)));
123
124/* Make sure that we don't accidentally use any normal C language built-in
125 type names in the first part of this file. Instead we want to use *only*
126 the type names defined above. The following macro definitions insure
127 that if we *do* accidentally use some normal C language built-in type name,
128 we will get a syntax error. */
129
130#define char bogus_type
131#define short bogus_type
132#define int bogus_type
133#define long bogus_type
134#define unsigned bogus_type
135#define float bogus_type
136#define double bogus_type
137
6da9c622
RK
138#if MIN_UNITS_PER_WORD > 4
139#define W_TYPE_SIZE (8 * BITS_PER_UNIT)
140#define Wtype DItype
141#define UWtype UDItype
142#define HWtype DItype
143#define UHWtype UDItype
144#define DWtype TItype
145#define UDWtype UTItype
146#define __NW(a,b) __ ## a ## di ## b
147#define __NDW(a,b) __ ## a ## ti ## b
a8b462be
MH
148#elif MIN_UNITS_PER_WORD > 2 \
149 || (MIN_UNITS_PER_WORD > 1 && LONG_LONG_TYPE_SIZE > 32)
299b83b7
KG
150#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
151#define Wtype SItype
152#define UWtype USItype
153#define HWtype SItype
154#define UHWtype USItype
155#define DWtype DItype
156#define UDWtype UDItype
157#define __NW(a,b) __ ## a ## si ## b
158#define __NDW(a,b) __ ## a ## di ## b
aa63d244 159#elif MIN_UNITS_PER_WORD > 1
299b83b7
KG
160#define W_TYPE_SIZE (2 * BITS_PER_UNIT)
161#define Wtype HItype
162#define UWtype UHItype
163#define HWtype HItype
164#define UHWtype UHItype
165#define DWtype SItype
166#define UDWtype USItype
167#define __NW(a,b) __ ## a ## hi ## b
168#define __NDW(a,b) __ ## a ## si ## b
169#else
170#define W_TYPE_SIZE BITS_PER_UNIT
171#define Wtype QItype
172#define UWtype UQItype
173#define HWtype QItype
174#define UHWtype UQItype
175#define DWtype HItype
176#define UDWtype UHItype
177#define __NW(a,b) __ ## a ## qi ## b
178#define __NDW(a,b) __ ## a ## hi ## b
179#endif
180
5d0e6486
AO
181#define Wtype_MAX ((Wtype)(((UWtype)1 << (W_TYPE_SIZE - 1)) - 1))
182#define Wtype_MIN (- Wtype_MAX - 1)
183
6da9c622
RK
184#define __muldi3 __NDW(mul,3)
185#define __divdi3 __NDW(div,3)
186#define __udivdi3 __NDW(udiv,3)
187#define __moddi3 __NDW(mod,3)
188#define __umoddi3 __NDW(umod,3)
189#define __negdi2 __NDW(neg,2)
190#define __lshrdi3 __NDW(lshr,3)
191#define __ashldi3 __NDW(ashl,3)
192#define __ashrdi3 __NDW(ashr,3)
6da9c622
RK
193#define __cmpdi2 __NDW(cmp,2)
194#define __ucmpdi2 __NDW(ucmp,2)
195#define __udivmoddi4 __NDW(udivmod,4)
196#define __fixunstfDI __NDW(fixunstf,)
197#define __fixtfdi __NDW(fixtf,)
198#define __fixunsxfDI __NDW(fixunsxf,)
199#define __fixxfdi __NDW(fixxf,)
200#define __fixunsdfDI __NDW(fixunsdf,)
201#define __fixdfdi __NDW(fixdf,)
202#define __fixunssfDI __NDW(fixunssf,)
203#define __fixsfdi __NDW(fixsf,)
204#define __floatdixf __NDW(float,xf)
205#define __floatditf __NDW(float,tf)
206#define __floatdidf __NDW(float,df)
207#define __floatdisf __NDW(float,sf)
208#define __fixunsxfSI __NW(fixunsxf,)
209#define __fixunstfSI __NW(fixunstf,)
210#define __fixunsdfSI __NW(fixunsdf,)
211#define __fixunssfSI __NW(fixunssf,)
212
dfff898c 213#define __ffsSI2 __NW(ffs,2)
8275b011
RH
214#define __clzSI2 __NW(clz,2)
215#define __ctzSI2 __NW(ctz,2)
216#define __popcountSI2 __NW(popcount,2)
217#define __paritySI2 __NW(parity,2)
dfff898c 218#define __ffsDI2 __NDW(ffs,2)
8275b011
RH
219#define __clzDI2 __NDW(clz,2)
220#define __ctzDI2 __NDW(ctz,2)
221#define __popcountDI2 __NDW(popcount,2)
222#define __parityDI2 __NDW(parity,2)
dfff898c 223
d30d6e76
KG
224extern DWtype __muldi3 (DWtype, DWtype);
225extern DWtype __divdi3 (DWtype, DWtype);
226extern UDWtype __udivdi3 (UDWtype, UDWtype);
227extern UDWtype __umoddi3 (UDWtype, UDWtype);
228extern DWtype __moddi3 (DWtype, DWtype);
6da9c622 229
d30d6e76
KG
230/* __udivmoddi4 is static inline when building other libgcc2 portions. */
231#if (!defined (L_udivdi3) && !defined (L_divdi3) && \
232 !defined (L_umoddi3) && !defined (L_moddi3))
233extern UDWtype __udivmoddi4 (UDWtype, UDWtype, UDWtype *);
234#endif
235
236/* __negdi2 is static inline when building other libgcc2 portions. */
237#if !defined(L_divdi3) && !defined(L_moddi3)
238extern DWtype __negdi2 (DWtype);
239#endif
240
241extern DWtype __lshrdi3 (DWtype, word_type);
242extern DWtype __ashldi3 (DWtype, word_type);
243extern DWtype __ashrdi3 (DWtype, word_type);
2928cd7a 244
d30d6e76
KG
245/* __udiv_w_sdiv is static inline when building other libgcc2 portions. */
246#if (!defined(L_udivdi3) && !defined(L_divdi3) && \
247 !defined(L_umoddi3) && !defined(L_moddi3))
248extern UWtype __udiv_w_sdiv (UWtype *, UWtype, UWtype, UWtype);
249#endif
250
251extern word_type __cmpdi2 (DWtype, DWtype);
252extern word_type __ucmpdi2 (DWtype, DWtype);
253
66f77154
MH
254extern Wtype __absvsi2 (Wtype);
255extern DWtype __absvdi2 (DWtype);
256extern Wtype __addvsi3 (Wtype, Wtype);
257extern DWtype __addvdi3 (DWtype, DWtype);
258extern Wtype __subvsi3 (Wtype, Wtype);
259extern DWtype __subvdi3 (DWtype, DWtype);
260extern Wtype __mulvsi3 (Wtype, Wtype);
261extern DWtype __mulvdi3 (DWtype, DWtype);
262extern Wtype __negvsi2 (Wtype);
263extern DWtype __negvdi2 (DWtype);
8f54374e 264
d30d6e76
KG
265#if BITS_PER_UNIT == 8
266extern DWtype __fixdfdi (DFtype);
267extern DWtype __fixsfdi (SFtype);
268extern DFtype __floatdidf (DWtype);
269extern SFtype __floatdisf (DWtype);
6da9c622
RK
270extern UWtype __fixunsdfSI (DFtype);
271extern UWtype __fixunssfSI (SFtype);
272extern DWtype __fixunsdfDI (DFtype);
273extern DWtype __fixunssfDI (SFtype);
d30d6e76
KG
274
275#if LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 96
276extern DWtype __fixxfdi (XFtype);
6da9c622 277extern DWtype __fixunsxfDI (XFtype);
d30d6e76 278extern XFtype __floatdixf (DWtype);
6da9c622 279extern UWtype __fixunsxfSI (XFtype);
d30d6e76
KG
280#endif
281
282#if LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128
6da9c622 283extern DWtype __fixunstfDI (TFtype);
d30d6e76
KG
284extern DWtype __fixtfdi (TFtype);
285extern TFtype __floatditf (DWtype);
286#endif
287#endif /* BITS_PER_UNIT == 8 */
288
299b83b7
KG
289/* DWstructs are pairs of Wtype values in the order determined by
290 LIBGCC2_WORDS_BIG_ENDIAN. */
291
292#if LIBGCC2_WORDS_BIG_ENDIAN
293 struct DWstruct {Wtype high, low;};
294#else
295 struct DWstruct {Wtype low, high;};
296#endif
297
298/* We need this union to unpack/pack DImode values, since we don't have
299 any arithmetic yet. Incoming DImode parameters are stored into the
300 `ll' field, and the unpacked result is read from the struct `s'. */
301
302typedef union
303{
304 struct DWstruct s;
305 DWtype ll;
306} DWunion;
307
299b83b7
KG
308#include "longlong.h"
309
88657302 310#endif /* ! GCC_LIBGCC2_H */