From 5ef9c8cf9627980c5912a5b0521d9888dd8d30b2 Mon Sep 17 00:00:00 2001 From: ludwig Date: Sat, 2 May 2009 17:15:51 +0000 Subject: align stack before re-entering engine to make sse work (#4051) git-svn-id: svn://svn.icculus.org/quake3/trunk@1533 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/vm_x86.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/qcommon/vm_x86.c b/code/qcommon/vm_x86.c index 8d1521b..7dee658 100644 --- a/code/qcommon/vm_x86.c +++ b/code/qcommon/vm_x86.c @@ -214,6 +214,9 @@ __asm__( "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 @@ __asm__( "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__ -- cgit v1.2.3