The basic idea of loop unrolling is that the number of instructions executed in a loop can be reduced by reducing the number of loop tests, sometimes reducing the amount of time spent in the loop.
Duff's device provides a compact loop unrolling by using the case keyword both inside and outside the loop.