Can I hint the optimizer by giving the range of an integer?
<p>I am using an <code>int</code> type to store a value. By the semantics of the program, the value always varies in a very small range (0 - 36), and <code>int</code> (not a <code>char</code>) is used only because of the CPU efficiency.</p>

<p>It seems like many special arithmetical optimizations can be performed on such a small range of integers. Many function calls on those integers might be optimized into a small set of "magical" operations, and some functions may even be optimized into table look-ups.</p>

<p>So, is it possible to tell the compiler that this <code>int</code> is always in that small range, and is it possible for the compiler to do those optimizations?</p>