diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-05-30 10:34:11 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-05-30 10:34:11 -0400 |
commit | 8ddae3488d9141bb94b8917e3c61c3e795833063 (patch) | |
tree | d30eb18033636eb66546a5ee3a01ed00d24f2fce | |
parent | a48fb61b5bbb8ae2f821875a07d0ac8ceb334e02 (diff) | |
download | gcc-8ddae3488d9141bb94b8917e3c61c3e795833063.zip gcc-8ddae3488d9141bb94b8917e3c61c3e795833063.tar.gz gcc-8ddae3488d9141bb94b8917e3c61c3e795833063.tar.bz2 |
(significand_size): New function.
From-SVN: r7387
-rw-r--r-- | gcc/real.c | 40 |
1 files changed, 39 insertions, 1 deletions
@@ -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 (); + } +} |