aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon
diff options
context:
space:
mode:
authorludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-05-02 17:15:51 +0000
committerludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-05-02 17:15:51 +0000
commit5ef9c8cf9627980c5912a5b0521d9888dd8d30b2 (patch)
tree5ee0bc54233440da482a4475cca26d698c2c78f5 /code/qcommon
parent59b2066496c50a9d6e7ed317da540d8e208cad23 (diff)
downloadioquake3-aero-5ef9c8cf9627980c5912a5b0521d9888dd8d30b2.tar.gz
ioquake3-aero-5ef9c8cf9627980c5912a5b0521d9888dd8d30b2.zip
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
Diffstat (limited to 'code/qcommon')
-rw-r--r--code/qcommon/vm_x86.c5
1 files changed, 5 insertions, 0 deletions
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__