From 8ddae3488d9141bb94b8917e3c61c3e795833063 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 30 May 1994 10:34:11 -0400 Subject: [PATCH] (significand_size): New function. From-SVN: r7387 --- gcc/real.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/gcc/real.c b/gcc/real.c index b56577b459f..49d88f77b55 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -5922,5 +5922,43 @@ esqrt (x, y) emdnorm (sq, k, 0, exp, 64); emovo (sq, y); } - #endif /* EMU_NON_COMPILE not defined */ + +/* Return the binary precision of the significand for a given + floating point mode. The mode can hold an integer value + that many bits wide, without losing any bits. */ + +int +significand_size (mode) + enum machine_mode mode; +{ + +switch (mode) + { + case SFmode: + return 24; + + case DFmode: +#if TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT + return 53; +#else +#if TARGET_FLOAT_FORMAT == IBM_FLOAT_FORMAT + return 56; +#else +#if TARGET_FLOAT_FORMAT == VAX_FLOAT_FORMAT + return 56; +#else + abort (); +#endif +#endif +#endif + + case XFmode: + return 64; + case TFmode: + return 113; + + default: + abort (); + } +} -- 2.30.2