]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
(significand_size): New function.
authorRichard Kenner <kenner@gcc.gnu.org>
Mon, 30 May 1994 14:34:11 +0000 (10:34 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 30 May 1994 14:34:11 +0000 (10:34 -0400)
From-SVN: r7387

gcc/real.c

index b56577b459f3e5fea6af88e05e8b046582e3d1ae..49d88f77b55541ebf0a678d6dbe3bc751067f75a 100644 (file)
@@ -5922,5 +5922,43 @@ esqrt (x, y)
   emdnorm (sq, k, 0, exp, 64);
   emovo (sq, y);
 }
-
 #endif /* EMU_NON_COMPILE not defined */
+\f
+/* 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 ();
+  }
+}