[riot-notifications] [RIOT-OS/RIOT] Question: bitfield tests (#7641)

Travis Griggs notifications at github.com
Sat Sep 23 03:00:49 CEST 2017


In #7638, I really like the stylistic change to testing struct bitfields. E.g.

` while (!(dev(uart)->INTFLAG.reg & SERCOM_USART_INTFLAG_DRE)) {}`

vs

`while (!dev(uart)->INTFLAG.bit.DRE) {}`

This reads a ton better. I'm curious what the performance/size implications of this pattern are though? I did some naive tests and found that the code size didn't change at all. But that the performance was quite a bit faster for good old fashioned masking. I would assume that some of the bitfield manipulations would imply shifts in additions to masks and tests.

Has anyone (who is better at testing) verified that we're not paying too much of a price for this improved coding pattern? 


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/7641
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20170923/6cebdcc5/attachment.html>


More information about the notifications mailing list