Loop unrolling is the compile-time expansion of a loop into repetitions of the code, with the loop index replaced by its value in each instance.
for (i = 0; i < 3; i++) disp[i] = c2[i] - c1[i];is expanded into:
disp = c2 - c1; disp = c2 - c1; disp = c2 - c1;
The second form runs faster, and it may generate less code. This is a useful optimization when the size of the loop is known to be a small constant at compile time.
Modulo unrolling unrolls a loop modulo some chosen constant. This can significantly reduce the loop overhead without expanding code size too much.