Have fun:
Code:
--- common/crc32.old Mon Dec 22 13:35:50 2003
+++ common/crc32.cpp Mon Dec 22 13:30:41 2003
@@ -161,17 +161,15 @@
return crc32;
}
#elif defined(i386)
- register uint32 val __asm ( "ax" );
- val = crc32;
__asm __volatile (
"xorl %%ebx, %%ebx\n"
- "movl %1, %%esi\n"
- "movl %2, %%ecx\n"
+ "movl $crc32, %%eax\n"
+ "movl %0, %%esi\n"
+ "movl %1, %%ecx\n"
"movl $CRC32Table, %%edi\n"
- "shrl $2, %%ecx\n"
+ "shrl $0, %%ecx\n"
"jz 1f\n"
-
".align 4\n"
"0:\n"
"movb %%al, %%bl\n"
@@ -203,7 +201,7 @@
"jnz 0b\n"
"1:\n"
- "movl %2, %%ecx\n"
+ "movl %1, %%ecx\n"
"andl $3, %%ecx\n"
"jz 2f\n"
@@ -229,11 +227,11 @@
"xorl (%%edi,%%ebx,4), %%eax\n"
"2:\n"
:
- : "a" (val), "g" (buf), "g" (bufsize)
+ : "g" (buf), "g" (bufsize)
: "ax", "bx", "cx", "dx", "si", "di"
);
- return val;
+ return crc32;
}
#else
for(uint32 i=0; i < bufsize; i++)
Edit: Code tags - kathgar