but host stores it in host endian-ness. */
#if HOST_FLOAT_WORDS_BIG_ENDIAN == FLOAT_WORDS_BIG_ENDIAN
-#define GET_REAL(r,e) e53toe ((r), (e))
-#define PUT_REAL(e,r) etoe53 ((e), (r))
+#define GET_REAL(r,e) e53toe ((unsigned EMUSHORT*) (r), (e))
+#define PUT_REAL(e,r) etoe53 ((e), (unsigned EMUSHORT *) (r))
#else /* endian-ness differs */
/* emulator uses target endian-ness internally */
#define GET_REAL(r,e) \
-do { EMUSHORT w[4]; \
+do { unsigned EMUSHORT w[4]; \
w[3] = ((EMUSHORT *) r)[0]; \
w[2] = ((EMUSHORT *) r)[1]; \
w[1] = ((EMUSHORT *) r)[2]; \
e53toe (w, (e)); } while (0)
#define PUT_REAL(e,r) \
-do { EMUSHORT w[4]; \
+do { unsigned EMUSHORT w[4]; \
etoe53 ((e), w); \
*((EMUSHORT *) r) = w[3]; \
*((EMUSHORT *) r + 1) = w[2]; \
#else /* not REAL_ARITHMETIC */
/* emulator uses host format */
-#define GET_REAL(r,e) e53toe ((r), (e))
-#define PUT_REAL(e,r) etoe53 ((e), (r))
+#define GET_REAL(r,e) e53toe ((unsigned EMUSHORT *) (r), (e))
+#define PUT_REAL(e,r) etoe53 ((e), (unsigned EMUSHORT *) (r))
#endif /* not REAL_ARITHMETIC */
#endif /* not TFmode */
/* The exponent of 1.0 */
#define EXONE (0x3fff)
-void warning ();
extern int extra_warnings;
-int ecmp (), enormlz (), eshift ();
-int eisneg (), eisinf (), eisnan (), eiisinf (), eiisnan (), eiisneg ();
-void eadd (), esub (), emul (), ediv ();
-void eshup1 (), eshup8 (), eshup6 (), eshdn1 (), eshdn8 (), eshdn6 ();
-void eabs (), eneg (), emov (), eclear (), einfin (), efloor ();
-void eldexp (), efrexp (), eifrac (), euifrac (), ltoe (), ultoe ();
-void ereal_to_decimal (), eiinfin (), einan ();
-void esqrt (), elog (), eexp (), etanh (), epow ();
-void asctoe (), asctoe24 (), asctoe53 (), asctoe64 (), asctoe113 ();
-void etoasc (), e24toasc (), e53toasc (), e64toasc (), e113toasc ();
-void etoe64 (), etoe53 (), etoe24 (), e64toe (), e53toe (), e24toe ();
-void etoe113 (), e113toe ();
-void mtherr (), make_nan ();
-void enan ();
extern unsigned EMUSHORT ezero[], ehalf[], eone[], etwo[];
extern unsigned EMUSHORT elog2[], esqrt2[];
+
+static void endian PROTO((unsigned EMUSHORT *, long *,
+ enum machine_mode));
+static void eclear PROTO((unsigned EMUSHORT *));
+static void emov PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void eabs PROTO((unsigned EMUSHORT *));
+static void eneg PROTO((unsigned EMUSHORT *));
+static int eisneg PROTO((unsigned EMUSHORT *));
+static int eisinf PROTO((unsigned EMUSHORT *));
+static int eisnan PROTO((unsigned EMUSHORT *));
+static void einfin PROTO((unsigned EMUSHORT *));
+static void enan PROTO((unsigned EMUSHORT *, int));
+static void emovi PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void emovo PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void ecleaz PROTO((unsigned EMUSHORT *));
+static void ecleazs PROTO((unsigned EMUSHORT *));
+static void emovz PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void einan PROTO((unsigned EMUSHORT *));
+static int eiisnan PROTO((unsigned EMUSHORT *));
+static int eiisneg PROTO((unsigned EMUSHORT *));
+static void eiinfin PROTO((unsigned EMUSHORT *));
+static int eiisinf PROTO((unsigned EMUSHORT *));
+static int ecmpm PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void eshdn1 PROTO((unsigned EMUSHORT *));
+static void eshup1 PROTO((unsigned EMUSHORT *));
+static void eshdn8 PROTO((unsigned EMUSHORT *));
+static void eshup8 PROTO((unsigned EMUSHORT *));
+static void eshup6 PROTO((unsigned EMUSHORT *));
+static void eshdn6 PROTO((unsigned EMUSHORT *));
+static void eaddm PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));\f
+static void esubm PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void m16m PROTO((unsigned short, unsigned short *,
+ unsigned short *));
+static int edivm PROTO((unsigned short *, unsigned short *));
+static int emulm PROTO((unsigned short *, unsigned short *));
+static void emdnorm PROTO((unsigned EMUSHORT *, int, int, EMULONG, int));
+static void esub PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *,
+ unsigned EMUSHORT *));
+static void eadd PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *,
+ unsigned EMUSHORT *));
+static void eadd1 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *,
+ unsigned EMUSHORT *));
+static void ediv PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *,
+ unsigned EMUSHORT *));
+static void emul PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *,
+ unsigned EMUSHORT *));
+static void e53toe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void e64toe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void e113toe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void e24toe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void etoe113 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void toe113 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void etoe64 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void toe64 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void etoe53 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void toe53 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void etoe24 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void toe24 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static int ecmp PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void eround PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void ltoe PROTO((HOST_WIDE_INT *, unsigned EMUSHORT *));
+static void ultoe PROTO((unsigned HOST_WIDE_INT *, unsigned EMUSHORT *));
+static void eifrac PROTO((unsigned EMUSHORT *, HOST_WIDE_INT *,
+ unsigned EMUSHORT *));
+static void euifrac PROTO((unsigned EMUSHORT *, unsigned HOST_WIDE_INT *,
+ unsigned EMUSHORT *));
+static int eshift PROTO((unsigned EMUSHORT *, int));
+static int enormlz PROTO((unsigned EMUSHORT *));
+static void e24toasc PROTO((unsigned EMUSHORT *, char *, int));
+static void e53toasc PROTO((unsigned EMUSHORT *, char *, int));
+static void e64toasc PROTO((unsigned EMUSHORT *, char *, int));
+static void e113toasc PROTO((unsigned EMUSHORT *, char *, int));
+static void etoasc PROTO((unsigned EMUSHORT *, char *, int));
+static void asctoe24 PROTO((char *, unsigned EMUSHORT *));
+static void asctoe53 PROTO((char *, unsigned EMUSHORT *));
+static void asctoe64 PROTO((char *, unsigned EMUSHORT *));
+static void asctoe113 PROTO((char *, unsigned EMUSHORT *));
+static void asctoe PROTO((char *, unsigned EMUSHORT *));
+static void asctoeg PROTO((char *, unsigned EMUSHORT *, int));
+static void efloor PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void efrexp PROTO((unsigned EMUSHORT *, int *,
+ unsigned EMUSHORT *));
+static void eldexp PROTO((unsigned EMUSHORT *, int, unsigned EMUSHORT *));
+static void eremain PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *,
+ unsigned EMUSHORT *));
+static void eiremain PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void mtherr PROTO((char *, int));
+static void dectoe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void etodec PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void todec PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void ibmtoe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *,
+ enum machine_mode));
+static void etoibm PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *,
+ enum machine_mode));
+static void toibm PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *,
+ enum machine_mode));
+static void make_nan PROTO((unsigned EMUSHORT *, int, enum machine_mode));
+static void uditoe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void ditoe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void etoudi PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void etodi PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+static void esqrt PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
\f
/* Copy 32-bit numbers obtained from array containing 16-bit numbers,
swapping ends if required, into output array of longs. The
result is normally passed to fprintf by the ASM_OUTPUT_ macros. */
-void
+
+static void
endian (e, x, mode)
unsigned EMUSHORT e[];
long x[];
/* This is the implementation of the REAL_ARITHMETIC macro.
*/
+
void
earith (value, icode, r1, r2)
REAL_VALUE_TYPE *value;
/* REAL_VALUE_FROM_UNSIGNED_INT macro.
*/
+
void
ereal_from_uint (d, i, j)
REAL_VALUE_TYPE *d;
int rndprc = NBITS;
extern int rndprc;
-void eaddm (), esubm (), emdnorm (), asctoeg ();
static void toe24 (), toe53 (), toe64 (), toe113 ();
-void eremain (), einit (), eiremain ();
-int ecmpm (), edivm (), emulm ();
-void emovi (), emovo (), emovz (), ecleaz (), ecleazs (), eadd1 ();
-#ifdef DEC
-void etodec (), todec (), dectoe ();
-#endif
-#ifdef IBM
-void etoibm (), toibm (), ibmtoe ();
-#endif
-void
-einit ()
-{
-}
-
/*
; Clear out entire external format number.
;
; eclear (x);
*/
-void
+static void
eclear (x)
register unsigned EMUSHORT *x;
{
* emov (a, b);
*/
-void
+static void
emov (a, b)
register unsigned EMUSHORT *a, *b;
{
; eabs (x);
*/
-void
+static void
eabs (x)
- unsigned EMUSHORT x[]; /* x is the memory address of a short */
+ unsigned EMUSHORT x[];
{
-
- x[NE - 1] &= 0x7fff; /* sign is top bit of last word of external format */
+ /* sign is top bit of last word of external format */
+ x[NE - 1] &= 0x7fff;
}
; eneg (x);
*/
-void
+static void
eneg (x)
unsigned EMUSHORT x[];
{
/* Return 1 if sign bit of external format number is nonzero,
* else return zero.
*/
-int
+static int
eisneg (x)
unsigned EMUSHORT x[];
{
/* Return 1 if external format number is infinity.
* else return zero.
*/
-int
+
+static int
eisinf (x)
unsigned EMUSHORT x[];
{
The bit pattern is one that we defined, so we know for sure how to
detect it. */
-int
+static int
eisnan (x)
unsigned EMUSHORT x[];
{
/* Fill external format number with infinity pattern (IEEE)
or largest possible number (non-IEEE). */
-void
+static void
einfin (x)
register unsigned EMUSHORT *x;
{
This generates Intel's quiet NaN pattern for extended real.
The exponent is 7fff, the leading mantissa word is c000. */
-void
+static void
enan (x, sign)
register unsigned EMUSHORT *x;
int sign;
/* Move in external format number,
* converting it to internal format.
*/
-void
+static void
emovi (a, b)
unsigned EMUSHORT *a, *b;
{
/* Move internal format number out,
* converting it to external format.
*/
-void
+static void
emovo (a, b)
unsigned EMUSHORT *a, *b;
{
/* Clear out internal format number.
*/
-void
+static void
ecleaz (xi)
register unsigned EMUSHORT *xi;
{
/* same, but don't touch the sign. */
-void
+static void
ecleazs (xi)
register unsigned EMUSHORT *xi;
{
/* Move internal format number from a to b.
*/
-void
+
+static void
emovz (a, b)
register unsigned EMUSHORT *a, *b;
{
The explicit pattern for this is maximum exponent and
top two significand bits set. */
-void
+static void
einan (x)
unsigned EMUSHORT x[];
{
/* Return nonzero if internal format number is a NaN. */
-int
+static int
eiisnan (x)
unsigned EMUSHORT x[];
{
/* Return nonzero if sign of internal format number is nonzero. */
-int
+static int
eiisneg (x)
unsigned EMUSHORT x[];
{
/* Fill internal format number with infinity pattern.
This has maximum exponent and significand all zeros. */
-void
+static void
eiinfin (x)
unsigned EMUSHORT x[];
{
/* Return nonzero if internal format number is infinite. */
-int
+static int
eiisinf (x)
unsigned EMUSHORT x[];
{
; 0 if a == b
; -1 if a < b
*/
-int
+
+static int
ecmpm (a, b)
register unsigned EMUSHORT *a, *b;
{
; Shift significand down by 1 bit
*/
-void
+static void
eshdn1 (x)
register unsigned EMUSHORT *x;
{
; Shift significand up by 1 bit
*/
-void
+static void
eshup1 (x)
register unsigned EMUSHORT *x;
{
; Shift significand down by 8 bits
*/
-void
+static void
eshdn8 (x)
register unsigned EMUSHORT *x;
{
; Shift significand up by 8 bits
*/
-void
+static void
eshup8 (x)
register unsigned EMUSHORT *x;
{
; Shift significand up by 16 bits
*/
-void
+static void
eshup6 (x)
register unsigned EMUSHORT *x;
{
; Shift significand down by 16 bits
*/
-void
+static void
eshdn6 (x)
register unsigned EMUSHORT *x;
{
; x + y replaces y
*/
-void
+static void
eaddm (x, y)
unsigned EMUSHORT *x, *y;
{
; y - x replaces y
*/
-void
+static void
esubm (x, y)
unsigned EMUSHORT *x, *y;
{
/* Multiply significand of e-type number b
-by 16-bit quantity a, e-type result to c. */
+ by 16-bit quantity a, e-type result to c. */
-void
+static void
m16m (a, b, c)
unsigned short a;
unsigned short b[], c[];
/* Divide significands. Neither the numerator nor the denominator
is permitted to have its high guard word nonzero. */
-int
+static int
edivm (den, num)
unsigned short den[], num[];
{
/* Multiply significands */
-int
+static int
emulm (a, b)
unsigned short a[], b[];
{
static int re = 0;
static unsigned EMUSHORT rbit[NI];
-void
+static void
emdnorm (s, lost, subflg, exp, rcntrl)
unsigned EMUSHORT s[];
int lost;
static int subflg = 0;
-void
+static void
esub (a, b, c)
unsigned EMUSHORT *a, *b, *c;
{
; unsigned EMUSHORT a[NE], b[NE], c[NE];
; eadd (a, b, c); c = b + a
*/
-void
+
+static void
eadd (a, b, c)
unsigned EMUSHORT *a, *b, *c;
{
eadd1 (a, b, c);
}
-void
+static void
eadd1 (a, b, c)
unsigned EMUSHORT *a, *b, *c;
{
; unsigned EMUSHORT a[NE], b[NE], c[NE];
; ediv (a, b, c); c = b / a
*/
-void
+
+static void
ediv (a, b, c)
unsigned EMUSHORT *a, *b, *c;
{
; unsigned EMUSHORT a[NE], b[NE], c[NE];
; emul (a, b, c); c = b * a
*/
-void
+
+static void
emul (a, b, c)
unsigned EMUSHORT *a, *b, *c;
{
; unsigned EMUSHORT x[N+2];
; e53toe (&d, x);
*/
-void
+
+static void
e53toe (pe, y)
unsigned EMUSHORT *pe, *y;
{
#endif /* not DEC */
}
-void
+static void
e64toe (pe, y)
unsigned EMUSHORT *pe, *y;
{
}
-void
+static void
e113toe (pe, y)
unsigned EMUSHORT *pe, *y;
{
; unsigned EMUSHORT x[N+2];
; dtox (&d, x);
*/
-void
+
+static void
e24toe (pe, y)
unsigned EMUSHORT *pe, *y;
{
}
-void
+static void
etoe113 (x, e)
unsigned EMUSHORT *x, *e;
{
}
/* move out internal format to ieee long double */
+
static void
toe113 (a, b)
unsigned EMUSHORT *a, *b;
#endif
}
-void
+static void
etoe64 (x, e)
unsigned EMUSHORT *x, *e;
{
toe64 (xi, e);
}
+
/* move out internal format to ieee long double */
static void
toe64 (a, b)
#ifdef DEC
-void
+static void
etoe53 (x, e)
unsigned EMUSHORT *x, *e;
{
* -1 if a < b
* -2 if either a or b is a NaN.
*/
-int
+
+static int
ecmp (a, b)
unsigned EMUSHORT *a, *b;
{
* unsigned EMUSHORT x[NE], y[NE]
* eround (x, y);
*/
-void
+
+static void
eround (x, y)
unsigned EMUSHORT *x, *y;
{
; ltoe (&l, x);
; note &l is the memory address of l
*/
-void
+
+static void
ltoe (lp, y)
HOST_WIDE_INT *lp;
unsigned EMUSHORT *y;
; ltox (&l, x);
; note &l is the memory address of l
*/
-void
+
+static void
ultoe (lp, y)
unsigned HOST_WIDE_INT *lp;
unsigned EMUSHORT *y;
The output e-type fraction FRAC is the positive fractional
part of abs (X). */
-void
+static void
eifrac (x, i, frac)
unsigned EMUSHORT *x;
HOST_WIDE_INT *i;
A negative e type input yields integer output = 0
but correct fraction. */
-void
+static void
euifrac (x, i, frac)
unsigned EMUSHORT *x;
unsigned HOST_WIDE_INT *i;
; Shifts significand area up or down by the number of bits
; given by the variable sc.
*/
-int
+
+static int
eshift (x, sc)
unsigned EMUSHORT *x;
int sc;
; Shift normalizes the significand area pointed to by argument
; shift count (up = positive) is returned.
*/
-int
+
+static int
enormlz (x)
unsigned EMUSHORT x[];
{
};
#endif
-void
+static void
e24toasc (x, string, ndigs)
unsigned EMUSHORT x[];
char *string;
}
-void
+static void
e53toasc (x, string, ndigs)
unsigned EMUSHORT x[];
char *string;
}
-void
+static void
e64toasc (x, string, ndigs)
unsigned EMUSHORT x[];
char *string;
etoasc (w, string, ndigs);
}
-void
+static void
e113toasc (x, string, ndigs)
unsigned EMUSHORT x[];
char *string;
static char wstring[80]; /* working storage for ASCII output */
-void
+static void
etoasc (x, string, ndigs)
unsigned EMUSHORT x[];
char *string;
*/
/* ASCII to single */
-void
+
+static void
asctoe24 (s, y)
char *s;
unsigned EMUSHORT *y;
/* ASCII to double */
-void
+
+static void
asctoe53 (s, y)
char *s;
unsigned EMUSHORT *y;
/* ASCII to long double */
-void
+
+static void
asctoe64 (s, y)
char *s;
unsigned EMUSHORT *y;
}
/* ASCII to 128-bit long double */
-void
+
+static void
asctoe113 (s, y)
char *s;
unsigned EMUSHORT *y;
}
/* ASCII to super double */
-void
+static void
asctoe (s, y)
char *s;
unsigned EMUSHORT *y;
/* ASCII to e type, with specified rounding precision = oprec. */
-void
+static void
asctoeg (ss, y, oprec)
char *ss;
unsigned EMUSHORT *y;
0x0000,
};
-void
+static void
efloor (x, y)
unsigned EMUSHORT x[], y[];
{
* For example, 1.1 = 0.55 * 2**1
* Handles denormalized numbers properly using long integer exp.
*/
-void
+
+static void
efrexp (x, exp, s)
unsigned EMUSHORT x[];
int *exp;
*
* Returns y = x * 2**pwr2.
*/
-void
+
+static void
eldexp (x, pwr2, y)
unsigned EMUSHORT x[];
int pwr2;
/* c = remainder after dividing b by a
* Least significant integer quotient bits left in equot[].
*/
-void
+
+static void
eremain (a, b, c)
unsigned EMUSHORT a[], b[], c[];
{
emovo (num, c);
}
-void
+static void
eiremain (den, num)
unsigned EMUSHORT den[], num[];
{
int merror = 0;
extern int merror;
-void
+static void
mtherr (name, code)
char *name;
int code;
; EMUSHORT e[NE];
; dectoe (&d, e);
*/
-void
+
+static void
dectoe (d, e)
unsigned EMUSHORT *d;
unsigned EMUSHORT *e;
; etodec (e, &d);
*/
-void
+static void
etodec (x, d)
unsigned EMUSHORT *x, *d;
{
todec (xi, d);
}
-void
+static void
todec (x, y)
unsigned EMUSHORT *x, *y;
{
; enum machine_mode mode; SFmode/DFmode
; ibmtoe (&d, e, mode);
*/
-void
+
+static void
ibmtoe (d, e, mode)
unsigned EMUSHORT *d;
unsigned EMUSHORT *e;
; etoibm (e, &d, mode);
*/
-void
+static void
etoibm (x, d, mode)
unsigned EMUSHORT *x, *d;
enum machine_mode mode;
toibm (xi, d, mode);
}
-void
+static void
toibm (x, y, mode)
unsigned EMUSHORT *x, *y;
enum machine_mode mode;
#endif
-void
+static void
make_nan (nan, sign, mode)
-unsigned EMUSHORT *nan;
-int sign;
-enum machine_mode mode;
+ unsigned EMUSHORT *nan;
+ int sign;
+ enum machine_mode mode;
{
int n;
unsigned EMUSHORT *p;
The endian-ness of DImode follows the convention for integers,
so we use WORDS_BIG_ENDIAN here, not FLOAT_WORDS_BIG_ENDIAN. */
-void
+static void
uditoe (di, e)
unsigned EMUSHORT *di; /* Address of the 64-bit int. */
unsigned EMUSHORT *e;
/* Convert target computer signed 64-bit integer to e-type. */
-void
+static void
ditoe (di, e)
unsigned EMUSHORT *di; /* Address of the 64-bit int. */
unsigned EMUSHORT *e;
/* Convert e-type to unsigned 64-bit int. */
void
-etoudi (x, i)
+static etoudi (x, i)
unsigned EMUSHORT *x;
unsigned EMUSHORT *i;
{
/* Convert e-type to signed 64-bit int. */
-void
+static void
etodi (x, i)
unsigned EMUSHORT *x;
unsigned EMUSHORT *i;
static int esqinited = 0;
static unsigned short sqrndbit[NI];
-void
+static void
esqrt (x, y)
unsigned EMUSHORT *x, *y;
{