2 !!DESCRIPTION!! Implementation of Duff's device (loop unrolling).
4 !!LICENCE!! GPL, read COPYING.GPL
12 unsigned char success=0;
13 unsigned char failures=0;
14 unsigned char dummy=0;
16 #ifdef SUPPORT_BIT_TYPES
25 int acmp(char* a, char* b, int count)
29 for(i = 0; i < count; i++) {
37 void duffit (char* to, char* from, int count)
39 int n = (count + 7) / 8;
42 case 0: do { *to++ = *from++;
43 case 7: *to++ = *from++;
44 case 6: *to++ = *from++;
45 case 5: *to++ = *from++;
46 case 4: *to++ = *from++;
47 case 3: *to++ = *from++;
48 case 2: *to++ = *from++;
49 case 1: *to++ = *from++;
59 /* a and b should be different */
60 if(!acmp(a, b, ASIZE)) {
66 /* a and b should be the same */
67 if(acmp(a, b, ASIZE)) {
73 printf("failures: %d\n",failures);