prusa3d / Prusa-Firmware-MMU

Other
32 stars 15 forks source link

Optimise CircularIndex count() method #280

Closed gudnimg closed 1 year ago

gudnimg commented 1 year ago

Since head and tail are unsigned, with same bit width and always a power of 2, head - tail is always valid.

For example, head = 2, tail = 254 will yield 2 - 254 = 4

Sadly there is no change in memory

gudnimg commented 1 year ago

Took a look at the assembly output. It seems the generated assembly output is the same.