[quake3-commits] r1533 - trunk/code/qcommon

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat May 2 13:15:52 EDT 2009


Author: ludwig
Date: 2009-05-02 13:15:51 -0400 (Sat, 02 May 2009)
New Revision: 1533

Modified:
   trunk/code/qcommon/vm_x86.c
Log:
align stack before re-entering engine to make sse work (#4051)

Modified: trunk/code/qcommon/vm_x86.c
===================================================================
--- trunk/code/qcommon/vm_x86.c	2009-04-23 07:39:37 UTC (rev 1532)
+++ trunk/code/qcommon/vm_x86.c	2009-05-02 17:15:51 UTC (rev 1533)
@@ -214,6 +214,9 @@
 	"ret\n"
 	"0:\n\t" // system call
 	"notl  %eax\n\t"
+	"pushl %ebp\n\t"
+	"movl  %esp, %ebp\n\t"
+	"andl $-16, %esp\n\t" // align the stack so engine can use sse
 	"pushl %ecx\n\t"
 	"pushl %edi\n\t" // opStack
 	"pushl %esi\n\t" // programStack
@@ -221,6 +224,8 @@
 	"call  " CMANG(CallAsmCall) "\n\t"
 	"addl  $12, %esp\n\t"
 	"popl  %ecx\n\t"
+	"movl  %ebp, %esp\n\t"
+	"popl  %ebp\n\t"
 	"addl  $4, %edi\n\t"
 	"ret\n\t"
 #if defined __ELF__



More information about the quake3-commits mailing list