diff options
author | meissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-24 17:04:47 +0000 |
---|---|---|
committer | meissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-24 17:04:47 +0000 |
commit | 10de71e103272ab95d389659e312b95e6b86a65c (patch) | |
tree | ec50c8ab7786788a6da7d4f06b0cd93e9555d487 /gcc/dfp.c | |
parent | 99ad623febd84d2a9cf4c2d0ad950c48c650a624 (diff) | |
download | ppe42-gcc-10de71e103272ab95d389659e312b95e6b86a65c.tar.gz ppe42-gcc-10de71e103272ab95d389659e312b95e6b86a65c.zip |
Add BID decimal support
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123185 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dfp.c')
-rw-r--r-- | gcc/dfp.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/gcc/dfp.c b/gcc/dfp.c index b388f934393..c15afa91c90 100644 --- a/gcc/dfp.c +++ b/gcc/dfp.c @@ -1,5 +1,5 @@ /* Decimal floating point support. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. @@ -656,11 +656,9 @@ decimal_real_arithmetic (REAL_VALUE_TYPE *r, enum tree_code code, case NEGATE_EXPR: { - decimal128 *d128; *r = *op0; - d128 = (decimal128 *) r->sig; - /* Flip high bit. */ - d128->bytes[0] ^= 1 << 7; + /* Flip sign bit. */ + decimal128FlipSign ((decimal128 *) r->sig); /* Keep sign field in sync. */ r->sign ^= 1; } @@ -668,11 +666,9 @@ decimal_real_arithmetic (REAL_VALUE_TYPE *r, enum tree_code code, case ABS_EXPR: { - decimal128 *d128; *r = *op0; - d128 = (decimal128 *) r->sig; - /* Clear high bit. */ - d128->bytes[0] &= 0x7f; + /* Clear sign bit. */ + decimal128ClearSign ((decimal128 *) r->sig); /* Keep sign field in sync. */ r->sign = 0; } @@ -712,5 +708,5 @@ decimal_real_maxval (REAL_VALUE_TYPE *r, int sign, enum machine_mode mode) decimal_real_from_string (r, max); if (sign) - r->sig[0] |= 0x80000000; + decimal128SetSign ((decimal128 *) r->sig, 1); } |