Mail Archives: djgpp/1997/04/13/19:54:08
Erik Max Francis wrote:
>
> It should be noted for people who are wondering why they've seen masks
> used this way is that masking is equivalent to a modulus operation (and
> much faster) when the modulo (one greater than the mask) is an even power
> of two.
It should also be noted that gcc is very smart when it comes to
optimizations, and will probably convert modulus operators into masks
when you're modding with powers of two. It's okay to trust the
compiler! ;)
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com |
| God's final message to His Creation: | http://www.cs.com/fighteer |
| "We apologize for the inconvenience."| Fight against proprietary |
| - Douglas Adams | software - support the FSF!|
---------------------------------------------------------------------
- Raw text -