I agree with Jim. You can also do something similar to simplify packed logical shift right instructions ( psrlw/ psrld/ psrlq/vpsrlw/ vpsrld/ vpsrlq ). SSE2/AVX2 packed logical shift right instructions also evaluate to 0 if the shift count is greater than or equal to the element size. http://reviews.llvm.org/D3359