Skip to content
Snippets Groups Projects
Forked from OpenSource / Ardupilot
14191 commits behind, 2972 commits ahead of the upstream repository.
user avatar
justinbeech authored
Believe it or not, changing / 2^31 to >>31 saved 256 bytes in the "d" segment.

The reason is that GCC version prior to 4.3.5 does not have a count_leading_zeros (clz) assembler macro, so it uses a 256 byte lookup table called _clz
The _clz table gets pulled in if you do 64 bit division.
This tiny change is the only place that we do long long division.
Changing to a shift saves 256 bytes of ram.
5255512b