On Feb 19, 2016, at 9:57 AM, Christian Thalinger 
<christian.thalin...@oracle.com> wrote:
> 
> Why don’t you change the values to:
> 
>    static final byte LATIN1 = 1;
>    static final byte UTF16  = 2;


Not sure what you are asking, but here's my take on why 0,1 is the (slight) 
winner.
The values 0,1 are the log2 of the array element sizes 1,2, so they can be used 
with shift instructions.
With 1,2 they would have to be used with multiply instructions, or else tweaked 
back to shift inputs.
Most loops will speculate on the scale factor, but those loops which must work 
with a non-constant scale will be slightly cleaner with 0,1.

— John

Reply via email to