[MIPS] IP27: Fix slice logic to work for arbitrary number of slices.