Split out the shift code from visitBinary.