Pretty neat. I did find a bug while I was playing around with it though: it doesn't correctly translate Duff's device.
Thanks!
do {
to.set((from = from.shift(1)).get(-1));
} while(--count > 0);
which looks correct to me. Hence my question what orodley thinks is wrong. n = (count + 7) / 8;
switch (count % 8) {
case 0: do { *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
} while (--n > 0);
}
(extraneous register statements removed for conciseness)