This is the mail archive of the
mailing list for the GCC project.
Re: make sure struct real_value's bitfields are packed
- From: Roger Sayle <roger at eyesopen dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 21 Mar 2004 11:54:14 -0700 (MST)
- Subject: Re: make sure struct real_value's bitfields are packed
On 21 Mar 2004, Alexandre Oliva wrote:
> from Alexandre Oliva <firstname.lastname@example.org>
> * 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.
Ok for mainline. Thanks.
+#define REAL_EXP(REAL) \
+ ((int)((REAL)->uexp ^ (unsigned int)(1 << (EXP_BITS - 1))) \
+ - (1 << (EXP_BITS - 1)))
I hadn't come across this "(x ^ signbit) - signbit" idiom for
implementing sign-extension before. Nice.