[PATCH, libiberty] Fix (biased) exponent = 0 case in floatformat_to_double
Julian Brown
julian@codesourcery.com
Mon Apr 24 18:23:00 GMT 2006
Hi,
This patch fixes a case in floatformat_to_double, as used in binutils
for disassembling floats for m68k (and soon ARM also). The failure mode
was as follows: the exponent was tested for zero after biasing, which is
true for floating point values 1.0 <= value < 2.0. Such values took a
code path intended for denormals, with the effect of causing them to
always produce the value 1.0 (or, perhaps, very close to 1.0).
This patch only processes values as denormal when special_exponent is true.
Tested with "make check" on CSL's current binutils branch, with targets
arm-none-eabi and --enable-targets=all (the ARM version includes a new
testcase which exercises some floating-point values).
The patch applies cleanly on GCC head's libiberty too, though I've not
explicitly tested it there. I suspect it'll also apply on binutils head.
OK to apply on src and gcc head, or is there any more testing I should do?
Cheers,
Julian
ChangeLog (libiberty):
* floatformat.c (floatformat_to_double): Fix (biased) exponent=0
case.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libiberty-floatformat-1
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060424/13b0d11a/attachment.ksh>
More information about the Gcc-patches
mailing list