RFA: patch to convert_doublest_to_floatformat in doublest.c

J. Johnston jjohnstn@redhat.com
Wed Jun 11 21:25:00 GMT 2003



Kevin Buettner wrote:
> On Jun 10,  3:16pm, J. Johnston wrote:
> 
> 
>>The old algorithm is correct for floating values whereby there are
>>32 or more mantissa bits.  In such a case, we only can put 31 bits
>>into the result.  A simple test was added.  The patch has been
>>tested on the ia64 and x86.
> 
> 
> I'm wondering about the test that you added.  You say that the old
> algorithm was correct for 32 or *more* mantissa bits.  Yet the test
> you added is as follows:
> 
> 
>>+          if (mant_bits == 32)
> 
> 
> I'm wondering if this should instead be:
> 
>              if (mant_bits >= 32)
> 
> ?
> 
> Kevin
> 

No, it is ok.  The algorithm only processes 32 bits at a time.  If
you look earlier, you will see:

       mant_bits = mant_bits_left < 32 ? mant_bits_left : 32;

-- Jeff J.



More information about the Gdb-patches mailing list