This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: make sure struct real_value's bitfields are packed


On 21 Mar 2004, Alexandre Oliva wrote:
> from  Alexandre Oliva  <aoliva@redhat.com>
>
>	* 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.

Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]