summaryrefslogtreecommitdiff
path: root/gcc/real.h
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-22 00:40:44 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-22 00:40:44 +0000
commit9d96125bd92098816efc0ff2f478c8555be7bfad (patch)
tree7b5c6d97adab6e033ff6faffa54cbc4e7d09046e /gcc/real.h
parent5341656c2cb3e3b2c0ad745457e83ff9b1cb70b0 (diff)
downloadgcc-9d96125bd92098816efc0ff2f478c8555be7bfad.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79802 138bc75d-0d04-0410-961f-82ee72b054a4
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 3ff0356bd65..475ab4563fe 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. */