OSDN Git Service

PR other/46202: implement install-strip.
[pf3gnuchains/gcc-fork.git] / libiberty / floatformat.c
index 07af726..4819507 100644 (file)
@@ -77,7 +77,23 @@ floatformat_always_valid (const struct floatformat *fmt ATTRIBUTE_UNUSED,
    a system header, what we do if not, etc.  */
 #define FLOATFORMAT_CHAR_BIT 8
 
-/* floatformats for IEEE single and double, big and little endian.  */
+/* floatformats for IEEE half, single and double, big and little endian.  */
+const struct floatformat floatformat_ieee_half_big =
+{
+  floatformat_big, 16, 0, 1, 5, 15, 31, 6, 10,
+  floatformat_intbit_no,
+  "floatformat_ieee_half_big",
+  floatformat_always_valid,
+  NULL
+};
+const struct floatformat floatformat_ieee_half_little =
+{
+  floatformat_little, 16, 0, 1, 5, 15, 31, 6, 10,
+  floatformat_intbit_no,
+  "floatformat_ieee_half_little",
+  floatformat_always_valid,
+  NULL
+};
 const struct floatformat floatformat_ieee_single_big =
 {
   floatformat_big, 32, 0, 1, 8, 127, 255, 9, 23,
@@ -283,7 +299,7 @@ floatformat_ibm_long_double_is_valid (const struct floatformat *fmt,
   bot_exp = get_field (ufrom + 8, hfmt->byteorder, hfmt->totalsize,
                       hfmt->exp_start, hfmt->exp_len);
 
-  if (top_exp == hfmt->exp_nan)
+  if ((unsigned long) top_exp == hfmt->exp_nan)
     top_nan = mant_bits_set (hfmt, ufrom);
 
   /* A NaN is valid with any low part.  */
@@ -292,11 +308,8 @@ floatformat_ibm_long_double_is_valid (const struct floatformat *fmt,
 
   /* An infinity, zero or denormal requires low part 0 (positive or
      negative).  */
-  if (top_exp == hfmt->exp_nan || top_exp == 0)
+  if ((unsigned long) top_exp == hfmt->exp_nan || top_exp == 0)
     {
-      unsigned int mant_bits, mant_off;
-      int mant_bits_left;
-
       if (bot_exp != 0)
        return 0;
 
@@ -318,7 +331,7 @@ floatformat_ibm_long_double_is_valid (const struct floatformat *fmt,
       /* The bottom part is 0 or denormal.  Determine which, and if
         denormal the first two set bits.  */
       int first_bit = -1, second_bit = -1, cur_bit;
-      for (cur_bit = 0; cur_bit < hfmt->man_len; cur_bit++)
+      for (cur_bit = 0; (unsigned int) cur_bit < hfmt->man_len; cur_bit++)
        if (get_field (ufrom + 8, hfmt->byteorder, hfmt->totalsize,
                       hfmt->man_start + cur_bit, 1))
          {
@@ -363,7 +376,7 @@ const struct floatformat floatformat_ibm_long_double =
   floatformat_big, 128, 0, 1, 11, 1023, 2047, 12, 52,
   floatformat_intbit_no,
   "floatformat_ibm_long_double",
-  floatformat_always_valid,
+  floatformat_ibm_long_double_is_valid,
   &floatformat_ieee_double_big
 };
 \f