xref: /openbsd-src/gnu/usr.bin/gcc/gcc/config/fp-bit.h (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1*c87b03e5Sespie /* Header file for fp-bit.c.  */
2*c87b03e5Sespie /* Copyright (C) 2000, 2002, 2003
3*c87b03e5Sespie    Free Software Foundation, Inc.
4*c87b03e5Sespie 
5*c87b03e5Sespie This file is part of GNU CC.
6*c87b03e5Sespie 
7*c87b03e5Sespie GNU CC is free software; you can redistribute it and/or modify
8*c87b03e5Sespie it under the terms of the GNU General Public License as published by
9*c87b03e5Sespie the Free Software Foundation; either version 2, or (at your option)
10*c87b03e5Sespie any later version.
11*c87b03e5Sespie 
12*c87b03e5Sespie GNU CC is distributed in the hope that it will be useful,
13*c87b03e5Sespie but WITHOUT ANY WARRANTY; without even the implied warranty of
14*c87b03e5Sespie MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*c87b03e5Sespie GNU General Public License for more details.
16*c87b03e5Sespie 
17*c87b03e5Sespie You should have received a copy of the GNU General Public License
18*c87b03e5Sespie along with GNU CC; see the file COPYING.  If not, write to
19*c87b03e5Sespie the Free Software Foundation, 59 Temple Place - Suite 330,
20*c87b03e5Sespie Boston, MA 02111-1307, USA.  */
21*c87b03e5Sespie 
22*c87b03e5Sespie /* As a special exception, if you link this library with other files,
23*c87b03e5Sespie    some of which are compiled with GCC, to produce an executable,
24*c87b03e5Sespie    this library does not by itself cause the resulting executable
25*c87b03e5Sespie    to be covered by the GNU General Public License.
26*c87b03e5Sespie    This exception does not however invalidate any other reasons why
27*c87b03e5Sespie    the executable file might be covered by the GNU General Public License.  */
28*c87b03e5Sespie 
29*c87b03e5Sespie #ifndef GCC_FP_BIT_H
30*c87b03e5Sespie #define GCC_FP_BIT_H
31*c87b03e5Sespie 
32*c87b03e5Sespie /* Defining FINE_GRAINED_LIBRARIES allows one to select which routines
33*c87b03e5Sespie    from this file are compiled via additional -D options.
34*c87b03e5Sespie 
35*c87b03e5Sespie    This avoids the need to pull in the entire fp emulation library
36*c87b03e5Sespie    when only a small number of functions are needed.
37*c87b03e5Sespie 
38*c87b03e5Sespie    If FINE_GRAINED_LIBRARIES is not defined, then compile every
39*c87b03e5Sespie    suitable routine.  */
40*c87b03e5Sespie #ifndef FINE_GRAINED_LIBRARIES
41*c87b03e5Sespie #define L_pack_df
42*c87b03e5Sespie #define L_unpack_df
43*c87b03e5Sespie #define L_pack_sf
44*c87b03e5Sespie #define L_unpack_sf
45*c87b03e5Sespie #define L_addsub_sf
46*c87b03e5Sespie #define L_addsub_df
47*c87b03e5Sespie #define L_mul_sf
48*c87b03e5Sespie #define L_mul_df
49*c87b03e5Sespie #define L_div_sf
50*c87b03e5Sespie #define L_div_df
51*c87b03e5Sespie #define L_fpcmp_parts_sf
52*c87b03e5Sespie #define L_fpcmp_parts_df
53*c87b03e5Sespie #define L_compare_sf
54*c87b03e5Sespie #define L_compare_df
55*c87b03e5Sespie #define L_eq_sf
56*c87b03e5Sespie #define L_eq_df
57*c87b03e5Sespie #define L_ne_sf
58*c87b03e5Sespie #define L_ne_df
59*c87b03e5Sespie #define L_gt_sf
60*c87b03e5Sespie #define L_gt_df
61*c87b03e5Sespie #define L_ge_sf
62*c87b03e5Sespie #define L_ge_df
63*c87b03e5Sespie #define L_lt_sf
64*c87b03e5Sespie #define L_lt_df
65*c87b03e5Sespie #define L_le_sf
66*c87b03e5Sespie #define L_le_df
67*c87b03e5Sespie #define L_unord_sf
68*c87b03e5Sespie #define L_unord_df
69*c87b03e5Sespie #define L_usi_to_sf
70*c87b03e5Sespie #define L_usi_to_df
71*c87b03e5Sespie #define L_si_to_sf
72*c87b03e5Sespie #define L_si_to_df
73*c87b03e5Sespie #define L_sf_to_si
74*c87b03e5Sespie #define L_df_to_si
75*c87b03e5Sespie #define L_f_to_usi
76*c87b03e5Sespie #define L_df_to_usi
77*c87b03e5Sespie #define L_negate_sf
78*c87b03e5Sespie #define L_negate_df
79*c87b03e5Sespie #define L_make_sf
80*c87b03e5Sespie #define L_make_df
81*c87b03e5Sespie #define L_sf_to_df
82*c87b03e5Sespie #define L_df_to_sf
83*c87b03e5Sespie #ifdef FLOAT
84*c87b03e5Sespie #define L_thenan_sf
85*c87b03e5Sespie #else
86*c87b03e5Sespie #define L_thenan_df
87*c87b03e5Sespie #endif
88*c87b03e5Sespie #endif /* ! FINE_GRAINED_LIBRARIES */
89*c87b03e5Sespie 
90*c87b03e5Sespie #if __LDBL_MANT_DIG__ == 113 || __LDBL_MANT_DIG__ == 106
91*c87b03e5Sespie # define TMODES
92*c87b03e5Sespie #endif
93*c87b03e5Sespie 
94*c87b03e5Sespie typedef float SFtype __attribute__ ((mode (SF)));
95*c87b03e5Sespie typedef float DFtype __attribute__ ((mode (DF)));
96*c87b03e5Sespie #ifdef TMODES
97*c87b03e5Sespie typedef float TFtype __attribute__ ((mode (TF)));
98*c87b03e5Sespie #endif
99*c87b03e5Sespie 
100*c87b03e5Sespie typedef int HItype __attribute__ ((mode (HI)));
101*c87b03e5Sespie typedef int SItype __attribute__ ((mode (SI)));
102*c87b03e5Sespie typedef int DItype __attribute__ ((mode (DI)));
103*c87b03e5Sespie #ifdef TMODES
104*c87b03e5Sespie typedef int TItype __attribute__ ((mode (TI)));
105*c87b03e5Sespie #endif
106*c87b03e5Sespie 
107*c87b03e5Sespie /* The type of the result of a fp compare */
108*c87b03e5Sespie #ifndef CMPtype
109*c87b03e5Sespie #define CMPtype SItype
110*c87b03e5Sespie #endif
111*c87b03e5Sespie 
112*c87b03e5Sespie typedef unsigned int UHItype __attribute__ ((mode (HI)));
113*c87b03e5Sespie typedef unsigned int USItype __attribute__ ((mode (SI)));
114*c87b03e5Sespie typedef unsigned int UDItype __attribute__ ((mode (DI)));
115*c87b03e5Sespie #ifdef TMODES
116*c87b03e5Sespie typedef unsigned int UTItype __attribute__ ((mode (TI)));
117*c87b03e5Sespie #endif
118*c87b03e5Sespie 
119*c87b03e5Sespie #define MAX_USI_INT  (~(USItype)0)
120*c87b03e5Sespie #define MAX_SI_INT   ((SItype) (MAX_USI_INT >> 1))
121*c87b03e5Sespie #define BITS_PER_SI  (4 * BITS_PER_UNIT)
122*c87b03e5Sespie #ifdef TMODES
123*c87b03e5Sespie #define MAX_UDI_INT  (~(UDItype)0)
124*c87b03e5Sespie #define MAX_DI_INT   ((DItype) (MAX_UDI_INT >> 1))
125*c87b03e5Sespie #define BITS_PER_DI  (8 * BITS_PER_UNIT)
126*c87b03e5Sespie #endif
127*c87b03e5Sespie 
128*c87b03e5Sespie #ifdef FLOAT_ONLY
129*c87b03e5Sespie #define NO_DI_MODE
130*c87b03e5Sespie #endif
131*c87b03e5Sespie 
132*c87b03e5Sespie #ifdef TFLOAT
133*c87b03e5Sespie # ifndef TMODES
134*c87b03e5Sespie #  error "TFLOAT requires long double to have 113 bits of mantissa"
135*c87b03e5Sespie # endif
136*c87b03e5Sespie 
137*c87b03e5Sespie #	define PREFIXFPDP tp
138*c87b03e5Sespie #	define PREFIXSFDF tf
139*c87b03e5Sespie #	define NGARDS 10L /* Is this right? */
140*c87b03e5Sespie #	define GARDROUND 0x1ff
141*c87b03e5Sespie #	define GARDMASK  0x3ff
142*c87b03e5Sespie #	define GARDMSB   0x200
143*c87b03e5Sespie #	define FRAC_NBITS 128
144*c87b03e5Sespie 
145*c87b03e5Sespie # if __LDBL_MANT_DIG__ == 113 /* IEEE quad */
146*c87b03e5Sespie #	define EXPBITS 15
147*c87b03e5Sespie #	define EXPBIAS 16383
148*c87b03e5Sespie #	define EXPMAX (0x7fff)
149*c87b03e5Sespie #	define QUIET_NAN ((TItype)0x8 << 108)
150*c87b03e5Sespie #	define FRACHIGH  ((TItype)0x8 << 124)
151*c87b03e5Sespie #	define FRACHIGH2 ((TItype)0xc << 124)
152*c87b03e5Sespie #	define FRACBITS 112
153*c87b03e5Sespie # endif
154*c87b03e5Sespie 
155*c87b03e5Sespie # if __LDBL_MANT_DIG__ == 106 /* IBM extended (double+double) */
156*c87b03e5Sespie #	define EXPBITS 11
157*c87b03e5Sespie #	define EXPBIAS 1023
158*c87b03e5Sespie #	define EXPMAX (0x7ff)
159*c87b03e5Sespie #	define QUIET_NAN ((TItype)0x8 << (48 + 64))
160*c87b03e5Sespie #	define FRACHIGH  ((TItype)0x8 << 124)
161*c87b03e5Sespie #	define FRACHIGH2 ((TItype)0xc << 124)
162*c87b03e5Sespie #	define FRACBITS 105
163*c87b03e5Sespie #	define HALFFRACBITS 52
164*c87b03e5Sespie #	define HALFSHIFT 64
165*c87b03e5Sespie # endif
166*c87b03e5Sespie 
167*c87b03e5Sespie #	define pack_d __pack_t
168*c87b03e5Sespie #	define unpack_d __unpack_t
169*c87b03e5Sespie #	define __fpcmp_parts __fpcmp_parts_t
170*c87b03e5Sespie 	typedef UTItype fractype;
171*c87b03e5Sespie 	typedef UDItype halffractype;
172*c87b03e5Sespie 	typedef USItype qrtrfractype;
173*c87b03e5Sespie #define qrtrfractype qrtrfractype
174*c87b03e5Sespie 	typedef TFtype FLO_type;
175*c87b03e5Sespie 	typedef TItype intfrac;
176*c87b03e5Sespie #elif defined FLOAT
177*c87b03e5Sespie #	define NGARDS    7L
178*c87b03e5Sespie #	define GARDROUND 0x3f
179*c87b03e5Sespie #	define GARDMASK  0x7f
180*c87b03e5Sespie #	define GARDMSB   0x40
181*c87b03e5Sespie #	define EXPBITS 8
182*c87b03e5Sespie #	define EXPBIAS 127
183*c87b03e5Sespie #	define FRACBITS 23
184*c87b03e5Sespie #	define EXPMAX (0xff)
185*c87b03e5Sespie #	define QUIET_NAN 0x100000L
186*c87b03e5Sespie #	define FRAC_NBITS 32
187*c87b03e5Sespie #	define FRACHIGH  0x80000000L
188*c87b03e5Sespie #	define FRACHIGH2 0xc0000000L
189*c87b03e5Sespie #	define pack_d __pack_f
190*c87b03e5Sespie #	define unpack_d __unpack_f
191*c87b03e5Sespie #	define __fpcmp_parts __fpcmp_parts_f
192*c87b03e5Sespie 	typedef USItype fractype;
193*c87b03e5Sespie 	typedef UHItype halffractype;
194*c87b03e5Sespie 	typedef SFtype FLO_type;
195*c87b03e5Sespie 	typedef SItype intfrac;
196*c87b03e5Sespie 
197*c87b03e5Sespie #else
198*c87b03e5Sespie #	define PREFIXFPDP dp
199*c87b03e5Sespie #	define PREFIXSFDF df
200*c87b03e5Sespie #	define NGARDS 8L
201*c87b03e5Sespie #	define GARDROUND 0x7f
202*c87b03e5Sespie #	define GARDMASK  0xff
203*c87b03e5Sespie #	define GARDMSB   0x80
204*c87b03e5Sespie #	define EXPBITS 11
205*c87b03e5Sespie #	define EXPBIAS 1023
206*c87b03e5Sespie #	define FRACBITS 52
207*c87b03e5Sespie #	define EXPMAX (0x7ff)
208*c87b03e5Sespie #	define QUIET_NAN 0x8000000000000LL
209*c87b03e5Sespie #	define FRAC_NBITS 64
210*c87b03e5Sespie #	define FRACHIGH  0x8000000000000000LL
211*c87b03e5Sespie #	define FRACHIGH2 0xc000000000000000LL
212*c87b03e5Sespie #	define pack_d __pack_d
213*c87b03e5Sespie #	define unpack_d __unpack_d
214*c87b03e5Sespie #	define __fpcmp_parts __fpcmp_parts_d
215*c87b03e5Sespie 	typedef UDItype fractype;
216*c87b03e5Sespie 	typedef USItype halffractype;
217*c87b03e5Sespie 	typedef DFtype FLO_type;
218*c87b03e5Sespie 	typedef DItype intfrac;
219*c87b03e5Sespie #endif /* FLOAT */
220*c87b03e5Sespie 
221*c87b03e5Sespie #ifdef US_SOFTWARE_GOFAST
222*c87b03e5Sespie #	ifdef TFLOAT
223*c87b03e5Sespie #		error "GOFAST TFmode not supported"
224*c87b03e5Sespie #	elif defined FLOAT
225*c87b03e5Sespie #		define add 		fpadd
226*c87b03e5Sespie #		define sub 		fpsub
227*c87b03e5Sespie #		define multiply 	fpmul
228*c87b03e5Sespie #		define divide 		fpdiv
229*c87b03e5Sespie #		define compare 		fpcmp
230*c87b03e5Sespie #		define _unord_f2	__unordsf2
231*c87b03e5Sespie #		define usi_to_float 	__floatunsisf
232*c87b03e5Sespie #		define si_to_float 	sitofp
233*c87b03e5Sespie #		define float_to_si 	fptosi
234*c87b03e5Sespie #		define float_to_usi 	fptoui
235*c87b03e5Sespie #		define negate 		__negsf2
236*c87b03e5Sespie #		define sf_to_df		fptodp
237*c87b03e5Sespie #		define sf_to_tf		__extendsftf2
238*c87b03e5Sespie #	else
239*c87b03e5Sespie #		define add 		dpadd
240*c87b03e5Sespie #		define sub 		dpsub
241*c87b03e5Sespie #		define multiply 	dpmul
242*c87b03e5Sespie #		define divide 		dpdiv
243*c87b03e5Sespie #		define compare 		dpcmp
244*c87b03e5Sespie #		define _unord_f2	__unorddf2
245*c87b03e5Sespie #		define usi_to_float 	__floatunsidf
246*c87b03e5Sespie #		define si_to_float 	litodp
247*c87b03e5Sespie #		define float_to_si 	dptoli
248*c87b03e5Sespie #		define float_to_usi 	dptoul
249*c87b03e5Sespie #		define negate 		__negdf2
250*c87b03e5Sespie #		define df_to_sf 	dptofp
251*c87b03e5Sespie #		define df_to_tf 	__extenddftf2
252*c87b03e5Sespie #	endif /* FLOAT */
253*c87b03e5Sespie #else
254*c87b03e5Sespie #	ifdef TFLOAT
255*c87b03e5Sespie #		define add 		__addtf3
256*c87b03e5Sespie #		define sub 		__subtf3
257*c87b03e5Sespie #		define multiply 	__multf3
258*c87b03e5Sespie #		define divide 		__divtf3
259*c87b03e5Sespie #		define compare 		__cmptf2
260*c87b03e5Sespie #		define _eq_f2 		__eqtf2
261*c87b03e5Sespie #		define _ne_f2 		__netf2
262*c87b03e5Sespie #		define _gt_f2 		__gttf2
263*c87b03e5Sespie #		define _ge_f2 		__getf2
264*c87b03e5Sespie #		define _lt_f2 		__lttf2
265*c87b03e5Sespie #		define _le_f2 		__letf2
266*c87b03e5Sespie #		define _unord_f2	__unordtf2
267*c87b03e5Sespie #		define usi_to_float 	__floatunsitf
268*c87b03e5Sespie #		define si_to_float 	__floatsitf
269*c87b03e5Sespie #		define float_to_si 	__fixtfsi
270*c87b03e5Sespie #		define float_to_usi 	__fixunstfsi
271*c87b03e5Sespie #		define negate 		__negtf2
272*c87b03e5Sespie #		define tf_to_sf		__trunctfsf2
273*c87b03e5Sespie #		define tf_to_df		__trunctfdf2
274*c87b03e5Sespie #	elif defined FLOAT
275*c87b03e5Sespie #		define add 		__addsf3
276*c87b03e5Sespie #		define sub 		__subsf3
277*c87b03e5Sespie #		define multiply 	__mulsf3
278*c87b03e5Sespie #		define divide 		__divsf3
279*c87b03e5Sespie #		define compare 		__cmpsf2
280*c87b03e5Sespie #		define _eq_f2 		__eqsf2
281*c87b03e5Sespie #		define _ne_f2 		__nesf2
282*c87b03e5Sespie #		define _gt_f2 		__gtsf2
283*c87b03e5Sespie #		define _ge_f2 		__gesf2
284*c87b03e5Sespie #		define _lt_f2 		__ltsf2
285*c87b03e5Sespie #		define _le_f2 		__lesf2
286*c87b03e5Sespie #		define _unord_f2	__unordsf2
287*c87b03e5Sespie #		define usi_to_float 	__floatunsisf
288*c87b03e5Sespie #		define si_to_float 	__floatsisf
289*c87b03e5Sespie #		define float_to_si 	__fixsfsi
290*c87b03e5Sespie #		define float_to_usi 	__fixunssfsi
291*c87b03e5Sespie #		define negate 		__negsf2
292*c87b03e5Sespie #		define sf_to_df		__extendsfdf2
293*c87b03e5Sespie #		define sf_to_tf		__extendsftf2
294*c87b03e5Sespie #	else
295*c87b03e5Sespie #		define add 		__adddf3
296*c87b03e5Sespie #		define sub 		__subdf3
297*c87b03e5Sespie #		define multiply 	__muldf3
298*c87b03e5Sespie #		define divide 		__divdf3
299*c87b03e5Sespie #		define compare 		__cmpdf2
300*c87b03e5Sespie #		define _eq_f2 		__eqdf2
301*c87b03e5Sespie #		define _ne_f2 		__nedf2
302*c87b03e5Sespie #		define _gt_f2 		__gtdf2
303*c87b03e5Sespie #		define _ge_f2 		__gedf2
304*c87b03e5Sespie #		define _lt_f2 		__ltdf2
305*c87b03e5Sespie #		define _le_f2 		__ledf2
306*c87b03e5Sespie #		define _unord_f2	__unorddf2
307*c87b03e5Sespie #		define usi_to_float 	__floatunsidf
308*c87b03e5Sespie #		define si_to_float 	__floatsidf
309*c87b03e5Sespie #		define float_to_si 	__fixdfsi
310*c87b03e5Sespie #		define float_to_usi 	__fixunsdfsi
311*c87b03e5Sespie #		define negate 		__negdf2
312*c87b03e5Sespie #		define df_to_sf		__truncdfsf2
313*c87b03e5Sespie #		define df_to_tf		__extenddftf2
314*c87b03e5Sespie #	endif /* FLOAT */
315*c87b03e5Sespie #endif /* US_SOFTWARE_GOFAST */
316*c87b03e5Sespie 
317*c87b03e5Sespie #ifndef INLINE
318*c87b03e5Sespie #define INLINE __inline__
319*c87b03e5Sespie #endif
320*c87b03e5Sespie 
321*c87b03e5Sespie /* Preserve the sticky-bit when shifting fractions to the right.  */
322*c87b03e5Sespie #define LSHIFT(a) { a = (a & 1) | (a >> 1); }
323*c87b03e5Sespie 
324*c87b03e5Sespie /* numeric parameters */
325*c87b03e5Sespie /* F_D_BITOFF is the number of bits offset between the MSB of the mantissa
326*c87b03e5Sespie    of a float and of a double. Assumes there are only two float types.
327*c87b03e5Sespie    (double::FRAC_BITS+double::NGARDS-(float::FRAC_BITS-float::NGARDS))
328*c87b03e5Sespie  */
329*c87b03e5Sespie #define F_D_BITOFF (52+8-(23+7))
330*c87b03e5Sespie 
331*c87b03e5Sespie #ifdef TMODES
332*c87b03e5Sespie # define F_T_BITOFF (__LDBL_MANT_DIG__-1+10-(23+7))
333*c87b03e5Sespie # define D_T_BITOFF (__LDBL_MANT_DIG__-1+10-(52+8))
334*c87b03e5Sespie #endif
335*c87b03e5Sespie 
336*c87b03e5Sespie 
337*c87b03e5Sespie #define NORMAL_EXPMIN (-(EXPBIAS)+1)
338*c87b03e5Sespie #define IMPLICIT_1 ((fractype)1<<(FRACBITS+NGARDS))
339*c87b03e5Sespie #define IMPLICIT_2 ((fractype)1<<(FRACBITS+1+NGARDS))
340*c87b03e5Sespie 
341*c87b03e5Sespie /* common types */
342*c87b03e5Sespie 
343*c87b03e5Sespie typedef enum
344*c87b03e5Sespie {
345*c87b03e5Sespie   CLASS_SNAN,
346*c87b03e5Sespie   CLASS_QNAN,
347*c87b03e5Sespie   CLASS_ZERO,
348*c87b03e5Sespie   CLASS_NUMBER,
349*c87b03e5Sespie   CLASS_INFINITY
350*c87b03e5Sespie } fp_class_type;
351*c87b03e5Sespie 
352*c87b03e5Sespie typedef struct
353*c87b03e5Sespie {
354*c87b03e5Sespie #ifdef SMALL_MACHINE
355*c87b03e5Sespie   char class;
356*c87b03e5Sespie   unsigned char sign;
357*c87b03e5Sespie   short normal_exp;
358*c87b03e5Sespie #else
359*c87b03e5Sespie   fp_class_type class;
360*c87b03e5Sespie   unsigned int sign;
361*c87b03e5Sespie   int normal_exp;
362*c87b03e5Sespie #endif
363*c87b03e5Sespie 
364*c87b03e5Sespie   union
365*c87b03e5Sespie     {
366*c87b03e5Sespie       fractype ll;
367*c87b03e5Sespie       halffractype l[2];
368*c87b03e5Sespie     } fraction;
369*c87b03e5Sespie } fp_number_type;
370*c87b03e5Sespie 
371*c87b03e5Sespie typedef union
372*c87b03e5Sespie {
373*c87b03e5Sespie   FLO_type value;
374*c87b03e5Sespie   fractype value_raw;
375*c87b03e5Sespie 
376*c87b03e5Sespie #ifndef FLOAT
377*c87b03e5Sespie # ifdef qrtrfractype
378*c87b03e5Sespie   qrtrfractype qwords[4];
379*c87b03e5Sespie # else
380*c87b03e5Sespie   halffractype words[2];
381*c87b03e5Sespie # endif
382*c87b03e5Sespie #endif
383*c87b03e5Sespie 
384*c87b03e5Sespie #ifdef FLOAT_BIT_ORDER_MISMATCH
385*c87b03e5Sespie   struct
386*c87b03e5Sespie     {
387*c87b03e5Sespie       fractype fraction:FRACBITS __attribute__ ((packed));
388*c87b03e5Sespie       unsigned int exp:EXPBITS __attribute__ ((packed));
389*c87b03e5Sespie       unsigned int sign:1 __attribute__ ((packed));
390*c87b03e5Sespie     }
391*c87b03e5Sespie   bits;
392*c87b03e5Sespie #endif
393*c87b03e5Sespie 
394*c87b03e5Sespie #ifdef _DEBUG_BITFLOAT
395*c87b03e5Sespie   struct
396*c87b03e5Sespie     {
397*c87b03e5Sespie       unsigned int sign:1 __attribute__ ((packed));
398*c87b03e5Sespie       unsigned int exp:EXPBITS __attribute__ ((packed));
399*c87b03e5Sespie       fractype fraction:FRACBITS __attribute__ ((packed));
400*c87b03e5Sespie     }
401*c87b03e5Sespie   bits_big_endian;
402*c87b03e5Sespie 
403*c87b03e5Sespie   struct
404*c87b03e5Sespie     {
405*c87b03e5Sespie       fractype fraction:FRACBITS __attribute__ ((packed));
406*c87b03e5Sespie       unsigned int exp:EXPBITS __attribute__ ((packed));
407*c87b03e5Sespie       unsigned int sign:1 __attribute__ ((packed));
408*c87b03e5Sespie     }
409*c87b03e5Sespie   bits_little_endian;
410*c87b03e5Sespie #endif
411*c87b03e5Sespie }
412*c87b03e5Sespie FLO_union_type;
413*c87b03e5Sespie 
414*c87b03e5Sespie /* Prototypes */
415*c87b03e5Sespie 
416*c87b03e5Sespie #if defined(L_pack_df) || defined(L_pack_sf) || defined(L_pack_tf)
417*c87b03e5Sespie extern FLO_type pack_d (fp_number_type *);
418*c87b03e5Sespie #endif
419*c87b03e5Sespie 
420*c87b03e5Sespie extern void unpack_d (FLO_union_type *, fp_number_type *);
421*c87b03e5Sespie 
422*c87b03e5Sespie #if defined(L_addsub_sf) || defined(L_addsub_df) || defined(L_addsub_tf)
423*c87b03e5Sespie extern FLO_type add (FLO_type, FLO_type);
424*c87b03e5Sespie extern FLO_type sub (FLO_type, FLO_type);
425*c87b03e5Sespie #endif
426*c87b03e5Sespie 
427*c87b03e5Sespie #if defined(L_mul_sf) || defined(L_mul_df) || defined(L_mul_tf)
428*c87b03e5Sespie extern FLO_type multiply (FLO_type, FLO_type);
429*c87b03e5Sespie #endif
430*c87b03e5Sespie 
431*c87b03e5Sespie #if defined(L_div_sf) || defined(L_div_df) || defined(L_div_tf)
432*c87b03e5Sespie extern FLO_type divide (FLO_type, FLO_type);
433*c87b03e5Sespie #endif
434*c87b03e5Sespie 
435*c87b03e5Sespie extern int __fpcmp_parts (fp_number_type *, fp_number_type *);
436*c87b03e5Sespie 
437*c87b03e5Sespie #if defined(L_compare_sf) || defined(L_compare_df) || defined(L_compare_tf)
438*c87b03e5Sespie extern CMPtype compare (FLO_type, FLO_type);
439*c87b03e5Sespie #endif
440*c87b03e5Sespie 
441*c87b03e5Sespie #ifndef US_SOFTWARE_GOFAST
442*c87b03e5Sespie 
443*c87b03e5Sespie #if defined(L_eq_sf) || defined(L_eq_df) || defined(L_eq_tf)
444*c87b03e5Sespie extern CMPtype _eq_f2 (FLO_type, FLO_type);
445*c87b03e5Sespie #endif
446*c87b03e5Sespie 
447*c87b03e5Sespie #if defined(L_ne_sf) || defined(L_ne_df) || defined(L_ne_tf)
448*c87b03e5Sespie extern CMPtype _ne_f2 (FLO_type, FLO_type);
449*c87b03e5Sespie #endif
450*c87b03e5Sespie 
451*c87b03e5Sespie #if defined(L_gt_sf) || defined(L_gt_df) || defined(L_gt_tf)
452*c87b03e5Sespie extern CMPtype _gt_f2 (FLO_type, FLO_type);
453*c87b03e5Sespie #endif
454*c87b03e5Sespie 
455*c87b03e5Sespie #if defined(L_ge_sf) || defined(L_ge_df) || defined(L_ge_tf)
456*c87b03e5Sespie extern CMPtype _ge_f2 (FLO_type, FLO_type);
457*c87b03e5Sespie #endif
458*c87b03e5Sespie 
459*c87b03e5Sespie #if defined(L_lt_sf) || defined(L_lt_df) || defined(L_lt_tf)
460*c87b03e5Sespie extern CMPtype _lt_f2 (FLO_type, FLO_type);
461*c87b03e5Sespie #endif
462*c87b03e5Sespie 
463*c87b03e5Sespie #if defined(L_le_sf) || defined(L_le_df) || defined(L_le_tf)
464*c87b03e5Sespie extern CMPtype _le_f2 (FLO_type, FLO_type);
465*c87b03e5Sespie #endif
466*c87b03e5Sespie 
467*c87b03e5Sespie #if defined(L_unord_sf) || defined(L_unord_df) || defined(L_unord_tf)
468*c87b03e5Sespie extern CMPtype _unord_f2 (FLO_type, FLO_type);
469*c87b03e5Sespie #endif
470*c87b03e5Sespie 
471*c87b03e5Sespie #endif /* ! US_SOFTWARE_GOFAST */
472*c87b03e5Sespie 
473*c87b03e5Sespie #if defined(L_si_to_sf) || defined(L_si_to_df) || defined(L_si_to_tf)
474*c87b03e5Sespie extern FLO_type si_to_float (SItype);
475*c87b03e5Sespie #endif
476*c87b03e5Sespie 
477*c87b03e5Sespie #if defined(L_sf_to_si) || defined(L_df_to_si) || defined(L_tf_to_si)
478*c87b03e5Sespie extern SItype float_to_si (FLO_type);
479*c87b03e5Sespie #endif
480*c87b03e5Sespie 
481*c87b03e5Sespie #if defined(L_sf_to_usi) || defined(L_df_to_usi) || defined(L_tf_to_usi)
482*c87b03e5Sespie #if defined(US_SOFTWARE_GOFAST) || defined(L_tf_to_usi)
483*c87b03e5Sespie extern USItype float_to_usi (FLO_type);
484*c87b03e5Sespie #endif
485*c87b03e5Sespie #endif
486*c87b03e5Sespie 
487*c87b03e5Sespie #if defined(L_usi_to_sf) || defined(L_usi_to_df) || defined(L_usi_to_tf)
488*c87b03e5Sespie extern FLO_type usi_to_float (USItype);
489*c87b03e5Sespie #endif
490*c87b03e5Sespie 
491*c87b03e5Sespie #if defined(L_negate_sf) || defined(L_negate_df) || defined(L_negate_tf)
492*c87b03e5Sespie extern FLO_type negate (FLO_type);
493*c87b03e5Sespie #endif
494*c87b03e5Sespie 
495*c87b03e5Sespie #ifdef FLOAT
496*c87b03e5Sespie #if defined(L_make_sf)
497*c87b03e5Sespie extern SFtype __make_fp (fp_class_type, unsigned int, int, USItype);
498*c87b03e5Sespie #endif
499*c87b03e5Sespie #ifndef FLOAT_ONLY
500*c87b03e5Sespie extern DFtype __make_dp (fp_class_type, unsigned int, int, UDItype);
501*c87b03e5Sespie #if defined(L_sf_to_df)
502*c87b03e5Sespie extern DFtype sf_to_df (SFtype);
503*c87b03e5Sespie #endif
504*c87b03e5Sespie #if defined(L_sf_to_tf) && defined(TMODES)
505*c87b03e5Sespie extern TFtype sf_to_tf (SFtype);
506*c87b03e5Sespie #endif
507*c87b03e5Sespie #endif /* ! FLOAT_ONLY */
508*c87b03e5Sespie #endif /* FLOAT */
509*c87b03e5Sespie 
510*c87b03e5Sespie #ifndef FLOAT
511*c87b03e5Sespie extern SFtype __make_fp (fp_class_type, unsigned int, int, USItype);
512*c87b03e5Sespie #if defined(L_make_df)
513*c87b03e5Sespie extern DFtype __make_dp (fp_class_type, unsigned int, int, UDItype);
514*c87b03e5Sespie #endif
515*c87b03e5Sespie #if defined(L_df_to_sf)
516*c87b03e5Sespie extern SFtype df_to_sf (DFtype);
517*c87b03e5Sespie #endif
518*c87b03e5Sespie #if defined(L_df_to_tf) && defined(TMODES)
519*c87b03e5Sespie extern TFtype df_to_tf (DFtype);
520*c87b03e5Sespie #endif
521*c87b03e5Sespie #endif /* ! FLOAT */
522*c87b03e5Sespie 
523*c87b03e5Sespie #ifdef TMODES
524*c87b03e5Sespie extern DFtype __make_dp (fp_class_type, unsigned int, int, UDItype);
525*c87b03e5Sespie extern TFtype __make_tp (fp_class_type, unsigned int, int, UTItype);
526*c87b03e5Sespie #ifdef TFLOAT
527*c87b03e5Sespie #if defined(L_tf_to_sf)
528*c87b03e5Sespie extern SFtype tf_to_sf (TFtype);
529*c87b03e5Sespie #endif
530*c87b03e5Sespie #if defined(L_tf_to_df)
531*c87b03e5Sespie extern DFtype tf_to_df (TFtype);
532*c87b03e5Sespie #endif
533*c87b03e5Sespie #if defined(L_di_to_tf)
534*c87b03e5Sespie extern TFtype di_to_df (DItype);
535*c87b03e5Sespie #endif
536*c87b03e5Sespie #endif /* TFLOAT */
537*c87b03e5Sespie #endif /* TMODES */
538*c87b03e5Sespie 
539*c87b03e5Sespie #endif /* ! GCC_FP_BIT_H */
540