Rockbox mail archive
Subject: Re: Bit hacking
Fascinating stuff. Well worth reading.
But many of the tricks have notes indicating that they invoke
undefined behavior according to the C Standard, or that their
efficiency depends on the target system's assembly language
And in all cases, there's a more straightforward way to do these
things, a way that programmers following you won't have to puzzle out.
For all these reasons, I'd want to avoid these tricks in production
code unless there is a real need to conserve every cycle. and if
trimming cycles is so important, I'd want to do it only until it could
be replaced by assembly language versions for each target.
> Solves a lot of problems I have heard discussed in many places,
> including such as bit reversing - which I have heard discussed here
> ...may or may not be of interest to the bit gurus
Received on 2006-07-17
Page was last modified "Jan 10 2012" The Rockbox Crew