Fix build error.
GCC fails to optimize division/mod by 8 into bitshift/mask.