OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / real.c
index 043270c..1e1083f 100644 (file)
@@ -1862,6 +1862,11 @@ real_from_string (REAL_VALUE_TYPE *r, const char *str)
              str++;
            }
        }
+
+      /* If the mantissa is zero, ignore the exponent.  */
+      if (!cmp_significand_0 (r))
+       goto underflow;
+
       if (*str == 'p' || *str == 'P')
        {
          bool exp_neg = false;
@@ -1934,6 +1939,10 @@ real_from_string (REAL_VALUE_TYPE *r, const char *str)
            }
        }
 
+      /* If the mantissa is zero, ignore the exponent.  */
+      if (r->cl == rvc_zero)
+       goto underflow;
+
       if (*str == 'e' || *str == 'E')
        {
          bool exp_neg = false;
@@ -2193,8 +2202,12 @@ real_nan (REAL_VALUE_TYPE *r, const char *str, int quiet,
        str++;
       if (*str == '0')
        {
-         if (*++str == 'x')
-           str++, base = 16;
+         str++;
+         if (*str == 'x' || *str == 'X')
+           {
+             base = 16;
+             str++;
+           }
          else
            base = 8;
        }
@@ -4323,6 +4336,7 @@ const struct real_format i370_double_format =
     false
   };
 \f
+/* Encode real R into a single precision DFP value in BUF.  */
 static void
 encode_decimal_single (const struct real_format *fmt ATTRIBUTE_UNUSED,
                        long *buf ATTRIBUTE_UNUSED, 
@@ -4331,6 +4345,7 @@ encode_decimal_single (const struct real_format *fmt ATTRIBUTE_UNUSED,
   encode_decimal32 (fmt, buf, r);
 }
 
+/* Decode a single precision DFP value in BUF into a real R.  */
 static void 
 decode_decimal_single (const struct real_format *fmt ATTRIBUTE_UNUSED,
                       REAL_VALUE_TYPE *r ATTRIBUTE_UNUSED, 
@@ -4339,6 +4354,7 @@ decode_decimal_single (const struct real_format *fmt ATTRIBUTE_UNUSED,
   decode_decimal32 (fmt, r, buf);
 }
 
+/* Encode real R into a double precision DFP value in BUF.  */
 static void 
 encode_decimal_double (const struct real_format *fmt ATTRIBUTE_UNUSED,
                       long *buf ATTRIBUTE_UNUSED, 
@@ -4347,6 +4363,7 @@ encode_decimal_double (const struct real_format *fmt ATTRIBUTE_UNUSED,
   encode_decimal64 (fmt, buf, r);
 }
 
+/* Decode a double precision DFP value in BUF into a real R.  */
 static void 
 decode_decimal_double (const struct real_format *fmt ATTRIBUTE_UNUSED,
                       REAL_VALUE_TYPE *r ATTRIBUTE_UNUSED, 
@@ -4355,6 +4372,7 @@ decode_decimal_double (const struct real_format *fmt ATTRIBUTE_UNUSED,
   decode_decimal64 (fmt, r, buf);
 }
 
+/* Encode real R into a quad precision DFP value in BUF.  */
 static void 
 encode_decimal_quad (const struct real_format *fmt ATTRIBUTE_UNUSED,
                     long *buf ATTRIBUTE_UNUSED,
@@ -4363,6 +4381,7 @@ encode_decimal_quad (const struct real_format *fmt ATTRIBUTE_UNUSED,
   encode_decimal128 (fmt, buf, r);
 }
 
+/* Decode a quad precision DFP value in BUF into a real R.  */
 static void 
 decode_decimal_quad (const struct real_format *fmt ATTRIBUTE_UNUSED,
                     REAL_VALUE_TYPE *r ATTRIBUTE_UNUSED,
@@ -4371,7 +4390,7 @@ decode_decimal_quad (const struct real_format *fmt ATTRIBUTE_UNUSED,
   decode_decimal128 (fmt, r, buf);
 }
 
-/* Proposed IEEE 754r decimal floating point. */
+/* Single precision decimal floating point (IEEE 754R). */
 const struct real_format decimal_single_format =
   {
     encode_decimal_single,
@@ -4391,6 +4410,7 @@ const struct real_format decimal_single_format =
     true
   };
 
+/* Double precision decimal floating point (IEEE 754R). */
 const struct real_format decimal_double_format =
   {
     encode_decimal_double,
@@ -4410,6 +4430,7 @@ const struct real_format decimal_double_format =
     true
   };
 
+/* Quad precision decimal floating point (IEEE 754R). */
 const struct real_format decimal_quad_format =
   {
     encode_decimal_quad,
@@ -4418,8 +4439,8 @@ const struct real_format decimal_quad_format =
     1,  /* log10 */
     34,
     34,
-    -6414,
-    6413,
+    -6143,
+    6144,
     127,
     127,
     true,