billvaglienti / ProtoGen

Communications protocol generation software
MIT License
30 stars 16 forks source link

Changed div-by-8 to rs-by-3 #39

Closed SchrodingersGat closed 7 years ago

SchrodingersGat commented 7 years ago

The PIC18 compiler (read, POS) does not optimize out the divide-by-8 in the bitfieldspecial.c routine.

Replacing /8 with >>3 results in a performance boost for the PIC compiler of 60%.

@billvaglienti can you see any issues with this in general? Slightly reduces code readability but enforces good behavior by the compiler.