You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although the BitReverseTable is only used in a single function, it's possible to optimize it away either by doing the bit test in the function itself, or to use this code:
This compiles to a lot less than 256 bytes, it's using 15 cycles with no multiply or division, so is probably faster than accessing the SPI flash for the table.
It's difficult to say what's really going to be faster as SPI and cache make things more difficult to evaluate. Maybe you could try to measure it using xthal_get_ccount()
Although the BitReverseTable is only used in a single function, it's possible to optimize it away either by doing the bit test in the function itself, or to use this code:
This compiles to a lot less than 256 bytes, it's using 15 cycles with no multiply or division, so is probably faster than accessing the SPI flash for the table.
There's also a version with 2 multiplication:
It's using only 7 operations. Those operations are described in Bit Twiddling Hacks
By the way, even better the code could probably be replaced by:
The text was updated successfully, but these errors were encountered: