[riot-devel] bitfeilds

Hauke Petersen hauke.petersen at fu-berlin.de
Fri Oct 28 15:58:22 CEST 2016


Hi Neil,

On 27.10.2016 21:22, Neil Jones wrote:
>
> Ok so they are not outright banned but not recommended unless you can 
> prove there are not any code size penalties?
>
I would say yes. If the code size is the same, I would not mind using 
named bitfields.
>
> I'm now very interested in testing this on MIPS and will be querying 
> our compiler engineers if there is a difference. I wonder if the fact 
> that volatile acts as a compiler memory barrier that the compiled code 
> is larger?
>
Please share what you find out, I would be very interested in their view!

About the volatile: I think J├╝rgen put it very nicely in his description.

Cheers,
Hauke


> Neil
>
>
> On 27 Oct 2016 14:11, "Hauke Petersen" <hauke.petersen at fu-berlin.de 
> <mailto:hauke.petersen at fu-berlin.de>> wrote:
>
>     Sorry, saw Olegs mail only after I send mine...
>
>     Cheers,
>     Hauke
>
>     On 27.10.2016 15:06, Martine Lenders wrote:
>
>         Hi,
>
>         2016-10-27 15:01 GMT+02:00 Oleg Hahm <oliver.hahm at inria.fr
>         <mailto:oliver.hahm at inria.fr> <mailto:oliver.hahm at inria.fr
>         <mailto:oliver.hahm at inria.fr>>>:
>
>             Hi Martine!
>
>             On Thu, Oct 27, 2016 at 01:35:21PM +0200, Martine Lenders
>         wrote:
>             > >> As example I was able to save several 100 bytes of
>         ROM when
>             removing the
>             > >> named bitfield use from the samr21s peripheral drivers.
>             > >
>             > >
>             > I don't know about your specific code, but I was able to
>         show,
>             that a
>             > bitfield actually *saves* ROM [1].
>
>             In your example the variables were not volatile.
>
>
>         Right. That might be a factor ^^".
>
>         Cheers,
>         Martine
>
>
>         _______________________________________________
>         devel mailing list
>         devel at riot-os.org <mailto:devel at riot-os.org>
>         https://lists.riot-os.org/mailman/listinfo/devel
>         <https://lists.riot-os.org/mailman/listinfo/devel>
>
>
>     _______________________________________________
>     devel mailing list
>     devel at riot-os.org <mailto:devel at riot-os.org>
>     https://lists.riot-os.org/mailman/listinfo/devel
>     <https://lists.riot-os.org/mailman/listinfo/devel>
>
>
>
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel



More information about the devel mailing list