xref: /openbsd-src/gnu/usr.bin/gcc/gcc/config/m68k/fpgnulib.c (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1*c87b03e5Sespie /* This is a stripped down version of floatlib.c.  It supplies only those
2*c87b03e5Sespie    functions which exist in libgcc, but for which there is not assembly
3*c87b03e5Sespie    language versions in m68k/lb1sf68.asm.
4*c87b03e5Sespie 
5*c87b03e5Sespie    It also includes simplistic support for extended floats (by working in
6*c87b03e5Sespie    double precision).  You must compile this file again with -DEXTFLOAT
7*c87b03e5Sespie    to get this support.  */
8*c87b03e5Sespie 
9*c87b03e5Sespie /*
10*c87b03e5Sespie ** gnulib support for software floating point.
11*c87b03e5Sespie ** Copyright (C) 1991 by Pipeline Associates, Inc.  All rights reserved.
12*c87b03e5Sespie ** Permission is granted to do *anything* you want with this file,
13*c87b03e5Sespie ** commercial or otherwise, provided this message remains intact.  So there!
14*c87b03e5Sespie ** I would appreciate receiving any updates/patches/changes that anyone
15*c87b03e5Sespie ** makes, and am willing to be the repository for said changes (am I
16*c87b03e5Sespie ** making a big mistake?).
17*c87b03e5Sespie **
18*c87b03e5Sespie ** Pat Wood
19*c87b03e5Sespie ** Pipeline Associates, Inc.
20*c87b03e5Sespie ** pipeline!phw@motown.com or
21*c87b03e5Sespie ** sun!pipeline!phw or
22*c87b03e5Sespie ** uunet!motown!pipeline!phw
23*c87b03e5Sespie **
24*c87b03e5Sespie ** 05/01/91 -- V1.0 -- first release to gcc mailing lists
25*c87b03e5Sespie ** 05/04/91 -- V1.1 -- added float and double prototypes and return values
26*c87b03e5Sespie **                  -- fixed problems with adding and subtracting zero
27*c87b03e5Sespie **                  -- fixed rounding in truncdfsf2
28*c87b03e5Sespie **                  -- fixed SWAP define and tested on 386
29*c87b03e5Sespie */
30*c87b03e5Sespie 
31*c87b03e5Sespie /*
32*c87b03e5Sespie ** The following are routines that replace the gnulib soft floating point
33*c87b03e5Sespie ** routines that are called automatically when -msoft-float is selected.
34*c87b03e5Sespie ** The support single and double precision IEEE format, with provisions
35*c87b03e5Sespie ** for byte-swapped machines (tested on 386).  Some of the double-precision
36*c87b03e5Sespie ** routines work at full precision, but most of the hard ones simply punt
37*c87b03e5Sespie ** and call the single precision routines, producing a loss of accuracy.
38*c87b03e5Sespie ** long long support is not assumed or included.
39*c87b03e5Sespie ** Overall accuracy is close to IEEE (actually 68882) for single-precision
40*c87b03e5Sespie ** arithmetic.  I think there may still be a 1 in 1000 chance of a bit
41*c87b03e5Sespie ** being rounded the wrong way during a multiply.  I'm not fussy enough to
42*c87b03e5Sespie ** bother with it, but if anyone is, knock yourself out.
43*c87b03e5Sespie **
44*c87b03e5Sespie ** Efficiency has only been addressed where it was obvious that something
45*c87b03e5Sespie ** would make a big difference.  Anyone who wants to do this right for
46*c87b03e5Sespie ** best speed should go in and rewrite in assembler.
47*c87b03e5Sespie **
48*c87b03e5Sespie ** I have tested this only on a 68030 workstation and 386/ix integrated
49*c87b03e5Sespie ** in with -msoft-float.
50*c87b03e5Sespie */
51*c87b03e5Sespie 
52*c87b03e5Sespie /* the following deal with IEEE single-precision numbers */
53*c87b03e5Sespie #define EXCESS		126L
54*c87b03e5Sespie #define SIGNBIT		0x80000000L
55*c87b03e5Sespie #define HIDDEN		(1L << 23L)
56*c87b03e5Sespie #define SIGN(fp)	((fp) & SIGNBIT)
57*c87b03e5Sespie #define EXP(fp)		(((fp) >> 23L) & 0xFF)
58*c87b03e5Sespie #define MANT(fp)	(((fp) & 0x7FFFFFL) | HIDDEN)
59*c87b03e5Sespie #define PACK(s,e,m)	((s) | ((e) << 23L) | (m))
60*c87b03e5Sespie 
61*c87b03e5Sespie /* the following deal with IEEE double-precision numbers */
62*c87b03e5Sespie #define EXCESSD		1022
63*c87b03e5Sespie #define HIDDEND		(1L << 20L)
64*c87b03e5Sespie #define EXPDBITS	11
65*c87b03e5Sespie #define EXPDMASK	0x7FF
66*c87b03e5Sespie #define EXPD(fp)	(((fp.l.upper) >> 20L) & 0x7FFL)
67*c87b03e5Sespie #define SIGND(fp)	((fp.l.upper) & SIGNBIT)
68*c87b03e5Sespie #define MANTD(fp)	(((((fp.l.upper) & 0xFFFFF) | HIDDEND) << 10) | \
69*c87b03e5Sespie 				(fp.l.lower >> 22))
70*c87b03e5Sespie #define MANTDMASK	0xFFFFF /* mask of upper part */
71*c87b03e5Sespie 
72*c87b03e5Sespie /* the following deal with IEEE extended-precision numbers */
73*c87b03e5Sespie #define EXCESSX		16382
74*c87b03e5Sespie #define HIDDENX		(1L << 31L)
75*c87b03e5Sespie #define EXPXBITS	15
76*c87b03e5Sespie #define EXPXMASK	0x7FFF
77*c87b03e5Sespie #define EXPX(fp)	(((fp.l.upper) >> 16) & EXPXMASK)
78*c87b03e5Sespie #define SIGNX(fp)	((fp.l.upper) & SIGNBIT)
79*c87b03e5Sespie #define MANTXMASK	0x7FFFFFFF /* mask of upper part */
80*c87b03e5Sespie 
81*c87b03e5Sespie union double_long
82*c87b03e5Sespie {
83*c87b03e5Sespie   double d;
84*c87b03e5Sespie   struct {
85*c87b03e5Sespie       long upper;
86*c87b03e5Sespie       unsigned long lower;
87*c87b03e5Sespie     } l;
88*c87b03e5Sespie };
89*c87b03e5Sespie 
90*c87b03e5Sespie union float_long {
91*c87b03e5Sespie   float f;
92*c87b03e5Sespie   long l;
93*c87b03e5Sespie };
94*c87b03e5Sespie 
95*c87b03e5Sespie union long_double_long
96*c87b03e5Sespie {
97*c87b03e5Sespie   long double ld;
98*c87b03e5Sespie   struct
99*c87b03e5Sespie     {
100*c87b03e5Sespie       long upper;
101*c87b03e5Sespie       unsigned long middle;
102*c87b03e5Sespie       unsigned long lower;
103*c87b03e5Sespie     } l;
104*c87b03e5Sespie };
105*c87b03e5Sespie 
106*c87b03e5Sespie #ifndef EXTFLOAT
107*c87b03e5Sespie 
108*c87b03e5Sespie /* convert int to double */
109*c87b03e5Sespie double
__floatsidf(int a1)110*c87b03e5Sespie __floatsidf (int a1)
111*c87b03e5Sespie {
112*c87b03e5Sespie   long sign = 0, exp = 31 + EXCESSD;
113*c87b03e5Sespie   union double_long dl;
114*c87b03e5Sespie 
115*c87b03e5Sespie   if (!a1)
116*c87b03e5Sespie     {
117*c87b03e5Sespie       dl.l.upper = dl.l.lower = 0;
118*c87b03e5Sespie       return dl.d;
119*c87b03e5Sespie     }
120*c87b03e5Sespie 
121*c87b03e5Sespie   if (a1 < 0)
122*c87b03e5Sespie     {
123*c87b03e5Sespie       sign = SIGNBIT;
124*c87b03e5Sespie       a1 = -a1;
125*c87b03e5Sespie       if (a1 < 0)
126*c87b03e5Sespie 	{
127*c87b03e5Sespie 	  dl.l.upper = SIGNBIT | ((32 + EXCESSD) << 20L);
128*c87b03e5Sespie 	  dl.l.lower = 0;
129*c87b03e5Sespie 	  return dl.d;
130*c87b03e5Sespie         }
131*c87b03e5Sespie     }
132*c87b03e5Sespie 
133*c87b03e5Sespie   while (a1 < 0x1000000)
134*c87b03e5Sespie     {
135*c87b03e5Sespie       a1 <<= 4;
136*c87b03e5Sespie       exp -= 4;
137*c87b03e5Sespie     }
138*c87b03e5Sespie 
139*c87b03e5Sespie   while (a1 < 0x40000000)
140*c87b03e5Sespie     {
141*c87b03e5Sespie       a1 <<= 1;
142*c87b03e5Sespie       exp--;
143*c87b03e5Sespie     }
144*c87b03e5Sespie 
145*c87b03e5Sespie   /* pack up and go home */
146*c87b03e5Sespie   dl.l.upper = sign;
147*c87b03e5Sespie   dl.l.upper |= exp << 20L;
148*c87b03e5Sespie   dl.l.upper |= (a1 >> 10L) & ~HIDDEND;
149*c87b03e5Sespie   dl.l.lower = a1 << 22L;
150*c87b03e5Sespie 
151*c87b03e5Sespie   return dl.d;
152*c87b03e5Sespie }
153*c87b03e5Sespie 
154*c87b03e5Sespie /* convert int to float */
155*c87b03e5Sespie float
__floatsisf(int l)156*c87b03e5Sespie __floatsisf (int l)
157*c87b03e5Sespie {
158*c87b03e5Sespie   double foo = __floatsidf (l);
159*c87b03e5Sespie   return foo;
160*c87b03e5Sespie }
161*c87b03e5Sespie 
162*c87b03e5Sespie /* convert float to double */
163*c87b03e5Sespie double
__extendsfdf2(float a1)164*c87b03e5Sespie __extendsfdf2 (float a1)
165*c87b03e5Sespie {
166*c87b03e5Sespie   register union float_long fl1;
167*c87b03e5Sespie   register union double_long dl;
168*c87b03e5Sespie   register long exp;
169*c87b03e5Sespie 
170*c87b03e5Sespie   fl1.f = a1;
171*c87b03e5Sespie 
172*c87b03e5Sespie   if (!fl1.l)
173*c87b03e5Sespie     {
174*c87b03e5Sespie       dl.l.upper = dl.l.lower = 0;
175*c87b03e5Sespie       return dl.d;
176*c87b03e5Sespie     }
177*c87b03e5Sespie 
178*c87b03e5Sespie   dl.l.upper = SIGN (fl1.l);
179*c87b03e5Sespie   exp = EXP (fl1.l) - EXCESS + EXCESSD;
180*c87b03e5Sespie   dl.l.upper |= exp << 20;
181*c87b03e5Sespie   dl.l.upper |= (MANT (fl1.l) & ~HIDDEN) >> 3;
182*c87b03e5Sespie   dl.l.lower = MANT (fl1.l) << 29;
183*c87b03e5Sespie 
184*c87b03e5Sespie   return dl.d;
185*c87b03e5Sespie }
186*c87b03e5Sespie 
187*c87b03e5Sespie /* convert double to float */
188*c87b03e5Sespie float
__truncdfsf2(double a1)189*c87b03e5Sespie __truncdfsf2 (double a1)
190*c87b03e5Sespie {
191*c87b03e5Sespie   register long exp;
192*c87b03e5Sespie   register long mant;
193*c87b03e5Sespie   register union float_long fl;
194*c87b03e5Sespie   register union double_long dl1;
195*c87b03e5Sespie 
196*c87b03e5Sespie   dl1.d = a1;
197*c87b03e5Sespie 
198*c87b03e5Sespie   if (!dl1.l.upper && !dl1.l.lower)
199*c87b03e5Sespie     return 0;
200*c87b03e5Sespie 
201*c87b03e5Sespie   exp = EXPD (dl1) - EXCESSD + EXCESS;
202*c87b03e5Sespie 
203*c87b03e5Sespie   /* shift double mantissa 6 bits so we can round */
204*c87b03e5Sespie   mant = MANTD (dl1) >> 6;
205*c87b03e5Sespie 
206*c87b03e5Sespie   /* now round and shift down */
207*c87b03e5Sespie   mant += 1;
208*c87b03e5Sespie   mant >>= 1;
209*c87b03e5Sespie 
210*c87b03e5Sespie   /* did the round overflow? */
211*c87b03e5Sespie   if (mant & 0xFF000000)
212*c87b03e5Sespie     {
213*c87b03e5Sespie       mant >>= 1;
214*c87b03e5Sespie       exp++;
215*c87b03e5Sespie     }
216*c87b03e5Sespie 
217*c87b03e5Sespie   mant &= ~HIDDEN;
218*c87b03e5Sespie 
219*c87b03e5Sespie   /* pack up and go home */
220*c87b03e5Sespie   fl.l = PACK (SIGND (dl1), exp, mant);
221*c87b03e5Sespie   return (fl.f);
222*c87b03e5Sespie }
223*c87b03e5Sespie 
224*c87b03e5Sespie /* convert double to int */
225*c87b03e5Sespie int
__fixdfsi(double a1)226*c87b03e5Sespie __fixdfsi (double a1)
227*c87b03e5Sespie {
228*c87b03e5Sespie   register union double_long dl1;
229*c87b03e5Sespie   register long exp;
230*c87b03e5Sespie   register long l;
231*c87b03e5Sespie 
232*c87b03e5Sespie   dl1.d = a1;
233*c87b03e5Sespie 
234*c87b03e5Sespie   if (!dl1.l.upper && !dl1.l.lower)
235*c87b03e5Sespie     return 0;
236*c87b03e5Sespie 
237*c87b03e5Sespie   exp = EXPD (dl1) - EXCESSD - 31;
238*c87b03e5Sespie   l = MANTD (dl1);
239*c87b03e5Sespie 
240*c87b03e5Sespie   if (exp > 0)
241*c87b03e5Sespie     {
242*c87b03e5Sespie       /* Return largest integer.  */
243*c87b03e5Sespie       return SIGND (dl1) ? 0x80000000 : 0x7fffffff;
244*c87b03e5Sespie     }
245*c87b03e5Sespie 
246*c87b03e5Sespie   if (exp <= -32)
247*c87b03e5Sespie     return 0;
248*c87b03e5Sespie 
249*c87b03e5Sespie   /* shift down until exp = 0 */
250*c87b03e5Sespie   if (exp < 0)
251*c87b03e5Sespie     l >>= -exp;
252*c87b03e5Sespie 
253*c87b03e5Sespie   return (SIGND (dl1) ? -l : l);
254*c87b03e5Sespie }
255*c87b03e5Sespie 
256*c87b03e5Sespie /* convert float to int */
257*c87b03e5Sespie int
__fixsfsi(float a1)258*c87b03e5Sespie __fixsfsi (float a1)
259*c87b03e5Sespie {
260*c87b03e5Sespie   double foo = a1;
261*c87b03e5Sespie   return __fixdfsi (foo);
262*c87b03e5Sespie }
263*c87b03e5Sespie 
264*c87b03e5Sespie #else /* EXTFLOAT */
265*c87b03e5Sespie 
266*c87b03e5Sespie /* Primitive extended precision floating point support.
267*c87b03e5Sespie 
268*c87b03e5Sespie    We assume all numbers are normalized, don't do any rounding, etc.  */
269*c87b03e5Sespie 
270*c87b03e5Sespie /* Prototypes for the above in case we use them.  */
271*c87b03e5Sespie double __floatsidf (int);
272*c87b03e5Sespie float __floatsisf (int);
273*c87b03e5Sespie double __extendsfdf2 (float);
274*c87b03e5Sespie float __truncdfsf2 (double);
275*c87b03e5Sespie int __fixdfsi (double);
276*c87b03e5Sespie int __fixsfsi (float);
277*c87b03e5Sespie 
278*c87b03e5Sespie /* convert double to long double */
279*c87b03e5Sespie long double
__extenddfxf2(double d)280*c87b03e5Sespie __extenddfxf2 (double d)
281*c87b03e5Sespie {
282*c87b03e5Sespie   register union double_long dl;
283*c87b03e5Sespie   register union long_double_long ldl;
284*c87b03e5Sespie   register long exp;
285*c87b03e5Sespie 
286*c87b03e5Sespie   dl.d = d;
287*c87b03e5Sespie   /*printf ("dfxf in: %g\n", d);*/
288*c87b03e5Sespie 
289*c87b03e5Sespie   if (!dl.l.upper && !dl.l.lower)
290*c87b03e5Sespie     return 0;
291*c87b03e5Sespie 
292*c87b03e5Sespie   ldl.l.upper = SIGND (dl);
293*c87b03e5Sespie   exp = EXPD (dl) - EXCESSD + EXCESSX;
294*c87b03e5Sespie   ldl.l.upper |= exp << 16;
295*c87b03e5Sespie   ldl.l.middle = HIDDENX;
296*c87b03e5Sespie   /* 31-20: # mantissa bits in ldl.l.middle - # mantissa bits in dl.l.upper */
297*c87b03e5Sespie   ldl.l.middle |= (dl.l.upper & MANTDMASK) << (31 - 20);
298*c87b03e5Sespie   /* 1+20: explicit-integer-bit + # mantissa bits in dl.l.upper */
299*c87b03e5Sespie   ldl.l.middle |= dl.l.lower >> (1 + 20);
300*c87b03e5Sespie   /* 32 - 21: # bits of dl.l.lower in ldl.l.middle */
301*c87b03e5Sespie   ldl.l.lower = dl.l.lower << (32 - 21);
302*c87b03e5Sespie 
303*c87b03e5Sespie   /*printf ("dfxf out: %s\n", dumpxf (ldl.ld));*/
304*c87b03e5Sespie   return ldl.ld;
305*c87b03e5Sespie }
306*c87b03e5Sespie 
307*c87b03e5Sespie /* convert long double to double */
308*c87b03e5Sespie double
__truncxfdf2(long double ld)309*c87b03e5Sespie __truncxfdf2 (long double ld)
310*c87b03e5Sespie {
311*c87b03e5Sespie   register long exp;
312*c87b03e5Sespie   register union double_long dl;
313*c87b03e5Sespie   register union long_double_long ldl;
314*c87b03e5Sespie 
315*c87b03e5Sespie   ldl.ld = ld;
316*c87b03e5Sespie   /*printf ("xfdf in: %s\n", dumpxf (ld));*/
317*c87b03e5Sespie 
318*c87b03e5Sespie   if (!ldl.l.upper && !ldl.l.middle && !ldl.l.lower)
319*c87b03e5Sespie     return 0;
320*c87b03e5Sespie 
321*c87b03e5Sespie   exp = EXPX (ldl) - EXCESSX + EXCESSD;
322*c87b03e5Sespie   /* ??? quick and dirty: keep `exp' sane */
323*c87b03e5Sespie   if (exp >= EXPDMASK)
324*c87b03e5Sespie     exp = EXPDMASK - 1;
325*c87b03e5Sespie   dl.l.upper = SIGNX (ldl);
326*c87b03e5Sespie   dl.l.upper |= exp << (32 - (EXPDBITS + 1));
327*c87b03e5Sespie   /* +1-1: add one for sign bit, but take one off for explicit-integer-bit */
328*c87b03e5Sespie   dl.l.upper |= (ldl.l.middle & MANTXMASK) >> (EXPDBITS + 1 - 1);
329*c87b03e5Sespie   dl.l.lower = (ldl.l.middle & MANTXMASK) << (32 - (EXPDBITS + 1 - 1));
330*c87b03e5Sespie   dl.l.lower |= ldl.l.lower >> (EXPDBITS + 1 - 1);
331*c87b03e5Sespie 
332*c87b03e5Sespie   /*printf ("xfdf out: %g\n", dl.d);*/
333*c87b03e5Sespie   return dl.d;
334*c87b03e5Sespie }
335*c87b03e5Sespie 
336*c87b03e5Sespie /* convert a float to a long double */
337*c87b03e5Sespie long double
__extendsfxf2(float f)338*c87b03e5Sespie __extendsfxf2 (float f)
339*c87b03e5Sespie {
340*c87b03e5Sespie   long double foo = __extenddfxf2 (__extendsfdf2 (f));
341*c87b03e5Sespie   return foo;
342*c87b03e5Sespie }
343*c87b03e5Sespie 
344*c87b03e5Sespie /* convert a long double to a float */
345*c87b03e5Sespie float
__truncxfsf2(long double ld)346*c87b03e5Sespie __truncxfsf2 (long double ld)
347*c87b03e5Sespie {
348*c87b03e5Sespie   float foo = __truncdfsf2 (__truncxfdf2 (ld));
349*c87b03e5Sespie   return foo;
350*c87b03e5Sespie }
351*c87b03e5Sespie 
352*c87b03e5Sespie /* convert an int to a long double */
353*c87b03e5Sespie long double
__floatsixf(int l)354*c87b03e5Sespie __floatsixf (int l)
355*c87b03e5Sespie {
356*c87b03e5Sespie   double foo = __floatsidf (l);
357*c87b03e5Sespie   return foo;
358*c87b03e5Sespie }
359*c87b03e5Sespie 
360*c87b03e5Sespie /* convert a long double to an int */
361*c87b03e5Sespie int
__fixxfsi(long double ld)362*c87b03e5Sespie __fixxfsi (long double ld)
363*c87b03e5Sespie {
364*c87b03e5Sespie   int foo = __fixdfsi ((double) ld);
365*c87b03e5Sespie   return foo;
366*c87b03e5Sespie }
367*c87b03e5Sespie 
368*c87b03e5Sespie /* The remaining provide crude math support by working in double precision.  */
369*c87b03e5Sespie 
370*c87b03e5Sespie long double
__addxf3(long double x1,long double x2)371*c87b03e5Sespie __addxf3 (long double x1, long double x2)
372*c87b03e5Sespie {
373*c87b03e5Sespie   return (double) x1 + (double) x2;
374*c87b03e5Sespie }
375*c87b03e5Sespie 
376*c87b03e5Sespie long double
__subxf3(long double x1,long double x2)377*c87b03e5Sespie __subxf3 (long double x1, long double x2)
378*c87b03e5Sespie {
379*c87b03e5Sespie   return (double) x1 - (double) x2;
380*c87b03e5Sespie }
381*c87b03e5Sespie 
382*c87b03e5Sespie long double
__mulxf3(long double x1,long double x2)383*c87b03e5Sespie __mulxf3 (long double x1, long double x2)
384*c87b03e5Sespie {
385*c87b03e5Sespie   return (double) x1 * (double) x2;
386*c87b03e5Sespie }
387*c87b03e5Sespie 
388*c87b03e5Sespie long double
__divxf3(long double x1,long double x2)389*c87b03e5Sespie __divxf3 (long double x1, long double x2)
390*c87b03e5Sespie {
391*c87b03e5Sespie   return (double) x1 / (double) x2;
392*c87b03e5Sespie }
393*c87b03e5Sespie 
394*c87b03e5Sespie long double
__negxf2(long double x1)395*c87b03e5Sespie __negxf2 (long double x1)
396*c87b03e5Sespie {
397*c87b03e5Sespie   return - (double) x1;
398*c87b03e5Sespie }
399*c87b03e5Sespie 
400*c87b03e5Sespie long
__cmpxf2(long double x1,long double x2)401*c87b03e5Sespie __cmpxf2 (long double x1, long double x2)
402*c87b03e5Sespie {
403*c87b03e5Sespie   return __cmpdf2 ((double) x1, (double) x2);
404*c87b03e5Sespie }
405*c87b03e5Sespie 
406*c87b03e5Sespie long
__eqxf2(long double x1,long double x2)407*c87b03e5Sespie __eqxf2 (long double x1, long double x2)
408*c87b03e5Sespie {
409*c87b03e5Sespie   return __cmpdf2 ((double) x1, (double) x2);
410*c87b03e5Sespie }
411*c87b03e5Sespie 
412*c87b03e5Sespie long
__nexf2(long double x1,long double x2)413*c87b03e5Sespie __nexf2 (long double x1, long double x2)
414*c87b03e5Sespie {
415*c87b03e5Sespie   return __cmpdf2 ((double) x1, (double) x2);
416*c87b03e5Sespie }
417*c87b03e5Sespie 
418*c87b03e5Sespie long
__ltxf2(long double x1,long double x2)419*c87b03e5Sespie __ltxf2 (long double x1, long double x2)
420*c87b03e5Sespie {
421*c87b03e5Sespie   return __cmpdf2 ((double) x1, (double) x2);
422*c87b03e5Sespie }
423*c87b03e5Sespie 
424*c87b03e5Sespie long
__lexf2(long double x1,long double x2)425*c87b03e5Sespie __lexf2 (long double x1, long double x2)
426*c87b03e5Sespie {
427*c87b03e5Sespie   return __cmpdf2 ((double) x1, (double) x2);
428*c87b03e5Sespie }
429*c87b03e5Sespie 
430*c87b03e5Sespie long
__gtxf2(long double x1,long double x2)431*c87b03e5Sespie __gtxf2 (long double x1, long double x2)
432*c87b03e5Sespie {
433*c87b03e5Sespie   return __cmpdf2 ((double) x1, (double) x2);
434*c87b03e5Sespie }
435*c87b03e5Sespie 
436*c87b03e5Sespie long
__gexf2(long double x1,long double x2)437*c87b03e5Sespie __gexf2 (long double x1, long double x2)
438*c87b03e5Sespie {
439*c87b03e5Sespie   return __cmpdf2 ((double) x1, (double) x2);
440*c87b03e5Sespie }
441*c87b03e5Sespie 
442*c87b03e5Sespie #endif /* EXTFLOAT */
443