From 84fbc2252f471ea779339e8a6401810011a8a714 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Sat, 2 May 2009 17:15:51 +0000 Subject: [PATCH] align stack before re-entering engine to make sse work (#4051) --- 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 8d1521be..7dee658b 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__