aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-05-30 10:34:11 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-05-30 10:34:11 -0400
commit8ddae3488d9141bb94b8917e3c61c3e795833063 (patch)
treed30eb18033636eb66546a5ee3a01ed00d24f2fce /gcc
parenta48fb61b5bbb8ae2f821875a07d0ac8ceb334e02 (diff)
downloadgcc-8ddae3488d9141bb94b8917e3c61c3e795833063.zip
gcc-8ddae3488d9141bb94b8917e3c61c3e795833063.tar.gz
gcc-8ddae3488d9141bb94b8917e3c61c3e795833063.tar.bz2
(significand_size): New function.
From-SVN: r7387
Diffstat (limited to 'gcc')
-rw-r--r--gcc/real.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/gcc/real.c b/gcc/real.c
index b56577b..49d88f7 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 ();
+ }
+}