aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/fp-bit.c
diff options
context:
space:
mode:
authorGeoff Keating <geoffk@cygnus.com>2000-02-26 20:03:11 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2000-02-26 20:03:11 +0000
commit42235f853e242b9eff7a5fdeedbc742e8cffdfbc (patch)
tree6caf32187f73d401e29d454fd38d7141a7b11315 /gcc/config/fp-bit.c
parent3852e8afcc93fe600c7b47a25483592e1b8b9f71 (diff)
downloadgcc-42235f853e242b9eff7a5fdeedbc742e8cffdfbc.zip
gcc-42235f853e242b9eff7a5fdeedbc742e8cffdfbc.tar.gz
gcc-42235f853e242b9eff7a5fdeedbc742e8cffdfbc.tar.bz2
elfos.h (ASM_OUTPUT_LABELREF): Don't define.
* config/elfos.h (ASM_OUTPUT_LABELREF): Don't define. The default is right for most ELF targets. * config/ns32k/ns32k.h (ASM_OUTPUT_LABELREF): Don't define. Let the default file use %U properly. * config/sh/elf.h (ASM_OUTPUT_LABELREF): Don't define. Use the default. * config/fp-bit.c (pack_d): Properly handle rounding of denormal numbers. From-SVN: r32183
Diffstat (limited to 'gcc/config/fp-bit.c')
-rw-r--r--gcc/config/fp-bit.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c
index 8e9df1c..4d894e7 100644
--- a/gcc/config/fp-bit.c
+++ b/gcc/config/fp-bit.c
@@ -502,8 +502,25 @@ pack_d ( fp_number_type * src)
}
else
{
- /* Shift by the value */
- fraction >>= shift;
+ int lowbit = (fraction & ((1 << shift) - 1)) ? 1 : 0;
+ fraction = (fraction >> shift) | lowbit;
+ }
+ if ((fraction & GARDMASK) == GARDMSB)
+ {
+ if ((fraction & (1 << NGARDS)))
+ fraction += GARDROUND + 1;
+ }
+ else
+ {
+ /* Add to the guards to round up. */
+ fraction += GARDROUND;
+ }
+ /* Perhaps the rounding means we now need to change the
+ exponent. */
+ if (fraction >= IMPLICIT_2)
+ {
+ fraction >>= 1;
+ exp += 1;
}
fraction >>= NGARDS;
}