移32位在 c++ 语言里是未定义的,rjsp 说的很清楚。原文是这样的:(节选自 ISO/IEC 14882:2003(E),第五章,第八节,第一条)
The operands shall be of integral or enumeration type and integral promotions are performed. The type of
the result is that of the promoted left operand. The behavior is undefined if the right operand is negative, or
greater than or equal to the length in bits of the promoted left operand.
另过寒风问的那个问题,intel 手册里明确了(Intel(R) 64 and IA-32 Architectures Software Developer's Manual- Volume 2B: Instruction Set Reference, N-Z):
The destination operand can be a register or a memory location. The count operand can be an immediate value or the CL register. The count is masked to 5 bits (or 6 bits
if in 64-bit mode and REX.W is used). The count range is limited to 0 to 31 (or 63 if 64-bit mode and REX.W is used). A special opcode encoding is provided for a count of 1.