Mail Archives: djgpp/2002/04/03/03:05:29
sorry, I forgot to specify the variables:
char* A;
unsigned int* D;
unsigned int x,min;
register unsigned int j,row,q;
j is ebx , row is esi , q is edi
and then I had several errors , I don't like the AT&T-syntax.
Here is , what finally worked but gave only a speed improvement
of about 30% on my K6/2 :
//j=0;label1:j+=A[q+row];row=D[row];if(j<min && row!=x) goto label1;
m12:__asm__ __volatile__ ("
pushl %%ecx
pushl %%edx
pushl %%eax
movl %1,%%ecx
movl %2,%%edx
addl %%edi,%%ecx
xorl %%ebx,%%ebx
jmp label1
.p2align 4,,7
label1: movzbl (%%ecx,%%esi),%%eax
movl (%%edx,%%esi,4),%%esi
addl %%eax,%%ebx
cmpl _x,%%esi
je label2
cmpl _min,%%ebx
jb label1
label2: popl %%eax
popl %%edx
popl %%ecx
"
:"=g"(j)
:"g"(A),"g"(D)
);
- Raw text -