Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <sub>Unfortunately, the original "answer" was deleted and it contained a good bit of valuable discussion...here's the condensed version...</sub>
- After various attempts at getting GCC to perform loop unswitching, it appears (so far) that **the best solution is the use of a magic number** if portability is required, or resort to inline assembly otherwise.
- Attempted alternate portable solutions, which do not work on GCC 4.6.3, included:
- * Marking `k_local` `const` and `register` (no effect)
- * Changing `k_local` to unsigned and using a simpler one-sided check on the upper bound (no effect)
- * Making a trivial change to one side of the branch to prevent elimination of the conditional (no effect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement