Advertisement
Guest User

Untitled

a guest
Mar 21st, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <sub>Unfortunately, the original "answer" was deleted and it contained a good bit of valuable discussion...here's the condensed version...</sub>
  2.  
  3. 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.
  4.  
  5. Attempted alternate portable solutions, which do not work on GCC 4.6.3, included:
  6.  
  7. * Marking `k_local` `const` and `register` (no effect)
  8. * Changing `k_local` to unsigned and using a simpler one-sided check on the upper bound (no effect)
  9. * 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