Also fix undefined behaviour when shift equals the number of bits

LLVM states:  "If op2 is (statically or dynamically) negative or equal
to or larger than the number of bits in op1, the result is undefined."