我正在运行有时会产生以下代码的代码:
UInt32 current;
int left, right;
...
//sometimes left == right and no shift occurs
current <<= (32 + left - right);
//this works
current <<= (32 - right);
current <<= left;
对于任何值 >= 32,它都会出现,只有值 % 32 被移动。框架中是否发生了一些“优化”?