[LLVMdev] Shifting by too many bits

Chris Lattner sabre at nondot.org
Wed Aug 22 15:29:56 PDT 2007


On Wed, 22 Aug 2007, Jon Sargeant wrote:
> The documentation for SHL, LSHR, and ASHR is unclear.  What is the
> result of shifting by the number of bits in the left operand.  For example,
>
> <result> = shl i32 1, 32
> <result> = ashr i32 1, 32
> <result> = lshr i32 1, 32

the result is undefined.  These shift operators could return anything.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list