aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/fp-bit.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-04-09 19:30:29 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2003-04-09 19:30:29 +0000
commit9c951124f3269d8789a552bcac335768e1c79388 (patch)
treefe8062809336cb55ff529e95e721043f7b93fff6 /gcc/config/fp-bit.c
parentd1c9693eeb86a4e6fa6b0dd4526486211296fc06 (diff)
downloadgcc-9c951124f3269d8789a552bcac335768e1c79388.zip
gcc-9c951124f3269d8789a552bcac335768e1c79388.tar.gz
gcc-9c951124f3269d8789a552bcac335768e1c79388.tar.bz2
fp-bit.c (unpack_d): Handle pair of doubles with different signs correctly.
* config/fp-bit.c (unpack_d): Handle pair of doubles with different signs correctly. From-SVN: r65405
Diffstat (limited to 'gcc/config/fp-bit.c')
-rw-r--r--gcc/config/fp-bit.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c
index 2832f96..b8ac298 100644
--- a/gcc/config/fp-bit.c
+++ b/gcc/config/fp-bit.c
@@ -459,6 +459,7 @@ unpack_d (FLO_union_type * src, fp_number_type * dst)
if (exp != EXPMAX && exp != 0 && low != 0)
{
int lowexp = ((int)(low >> HALFFRACBITS)) & ((1 << EXPBITS) - 1);
+ int lowsign = ((int)(low >> (((HALFFRACBITS + EXPBITS))))) & 1;
int shift;
fractype xlow;
@@ -472,7 +473,10 @@ unpack_d (FLO_union_type * src, fp_number_type * dst)
xlow <<= shift;
else if (shift < 0)
xlow >>= -shift;
- fraction += xlow;
+ if (sign == lowsign)
+ fraction += xlow;
+ else
+ fraction -= xlow;
}
}
# else