aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.h
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2004-03-22 00:40:44 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2004-03-22 00:40:44 +0000
commit1e92bbb90760c6d3a55d9685228cf2e99dd40e8f (patch)
tree7b5c6d97adab6e033ff6faffa54cbc4e7d09046e /gcc/real.h
parent9175d40929b58aed64a94ecd1b4b8dcb3642f35b (diff)
downloadgcc-1e92bbb90760c6d3a55d9685228cf2e99dd40e8f.zip
gcc-1e92bbb90760c6d3a55d9685228cf2e99dd40e8f.tar.gz
gcc-1e92bbb90760c6d3a55d9685228cf2e99dd40e8f.tar.bz2
real.h (struct real_value): Use the same type for all bitfields.
* real.h (struct real_value): Use the same type for all bitfields. Rename exp to uexp. (REAL_EXP, SET_REAL_EXP): New accessor macros for uexp. Adjust all uses of exp... * builtins.c: ... here, ... * emit-rtl.c: ... here, and ... * real.c: ... and here. From-SVN: r79802
Diffstat (limited to 'gcc/real.h')
-rw-r--r--gcc/real.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/real.h b/gcc/real.h
index 3ff0356..475ab45 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -42,14 +42,23 @@ enum real_value_class {
struct real_value GTY(())
{
- ENUM_BITFIELD (real_value_class) class : 2;
+ /* Use the same underlying type for all bit-fields, so as to make
+ sure they're packed together, otherwise REAL_VALUE_TYPE_SIZE will
+ be miscomputed. */
+ unsigned int /* ENUM_BITFIELD (real_value_class) */ class : 2;
unsigned int sign : 1;
unsigned int signalling : 1;
unsigned int canonical : 1;
- signed int exp : EXP_BITS;
+ unsigned int uexp : EXP_BITS;
unsigned long sig[SIGSZ];
};
+#define REAL_EXP(REAL) \
+ ((int)((REAL)->uexp ^ (unsigned int)(1 << (EXP_BITS - 1))) \
+ - (1 << (EXP_BITS - 1)))
+#define SET_REAL_EXP(REAL, EXP) \
+ ((REAL)->uexp = ((unsigned int)(EXP) & (unsigned int)((1 << EXP_BITS) - 1)))
+
/* Various headers condition prototypes on #ifdef REAL_VALUE_TYPE, so it
needs to be a macro. We do need to continue to have a structure tag
so that other headers can forward declare it. */