Re: Optimization of bit field assignemnts

2024-02-13 Thread Richard Biener via Gcc
On Mon, Feb 12, 2024 at 5:49 PM Hugh Gleaves via Gcc wrote: > > I’m interested in whether it would be feasible to add an optimization that > compacted assignments to multiple bit fields. > > Today, if I have a 32 bit long struct composed of say, four 8 bit fields and > assign constants to them l

Re: Optimization of bit field assignemnts

2024-02-12 Thread David Brown
On 12/02/2024 17:47, Hugh Gleaves via Gcc wrote: I’m interested in whether it would be feasible to add an optimization that compacted assignments to multiple bit fields. Today, if I have a 32 bit long struct composed of say, four 8 bit fields and assign constants to them like this:

Optimization of bit field assignemnts

2024-02-12 Thread Hugh Gleaves via Gcc
I’m interested in whether it would be feasible to add an optimization that compacted assignments to multiple bit fields. Today, if I have a 32 bit long struct composed of say, four 8 bit fields and assign constants to them like this: ahb1_ptr->RCC.CFGR.MCO1_PRE = 7;