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] |
*bit_offset = (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (fld)) * BITS_PER_UNIT + TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (fld))) - (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (bitregion_start)) * BITS_PER_UNIT + TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (bitregion_start)));
(Yes, I know we can factor out the BITS_PER_UNIT and only do one multiplication, it's just easier to read this way.)
Is this what you had in mind?
Yes. For convenience I'd simply use double_ints for the intermediate calculations.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |