dededup some shift/rotate stuff