Reduces coordinates for primops CELL and CELL_VALUE to be in range [0..rows-1, 0..cols-1].