Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2003, 01:09 PM
daeken_bb
Discordant
 
Join Date: Mar 2003
Location: Chambersburg, PA
Posts: 469
Default Patch to compile crc32.cpp on GCC 3.3.x

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
__________________
Keep me unemployed and working on OpenEQ, PM me about donating

Check out my deviantART page at http://daeken.deviantart.com/
Reply With Quote
  #2  
Old 01-01-2004, 03:49 PM
var1ety
Sarnak
 
Join Date: Jan 2003
Posts: 59
Default eh

Eh, patch doesn't work for me. Already talked to Daeken in IRC, so he's aware of it. Temporarily fix for people that have to use gcc 3.3.x is to comment out the offending ASM, and use the C code instead.

This would take the form of:

(Line 136ish)

/*
#elif defined(i386)
....
*/
#else
for(uint32 i=0; i < bufsize; i++)
...
Reply With Quote
  #3  
Old 01-02-2004, 11:28 PM
DeletedUser
Fire Beetle
 
Join Date: Sep 2002
Posts: 0
Default

Could also just undefine i386, it's only used for triggering the crc32 asm code vs c++ code.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:20 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3