Bug 552627. Align stack correctly in xptcall so we can use SSE2 without crashing. r=timeless

This commit is contained in:
Yong 2010-06-01 11:55:49 +12:00
Родитель c5cbb41bca
Коммит eb6134382e
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -161,8 +161,14 @@ __asm__ (
* is assumed and required, e.g. by GCC4's -ftree-vectorize option. * is assumed and required, e.g. by GCC4's -ftree-vectorize option.
*/ */
"andl $0xfffffff0, %ecx\n\t" /* drop(?) stack ptr to 128-bit align */ "andl $0xfffffff0, %ecx\n\t" /* drop(?) stack ptr to 128-bit align */
"subl $8, %ecx\n\t" /* lower again; push/call below will re-align */ /* $esp should be aligned to a 16-byte boundary here (note we include an
* additional 4 bytes in a later push instruction). This will ensure $ebp
* in the function called below is aligned to a 0x8 boundary. SSE instructions
* like movapd/movdqa expect memory operand to be aligned on a 16-byte
* boundary. The GCC compiler will generate the memory operand using $ebp
* with an 8-byte offset.
*/
"subl $0xc, %ecx\n\t" /* lower again; push/call below will re-align */
"movl %ecx, %esp\n\t" /* make stack space */ "movl %ecx, %esp\n\t" /* make stack space */
"movl 0x14(%ebp), %edx\n\t" "movl 0x14(%ebp), %edx\n\t"
"call " SYMBOL_UNDERSCORE "invoke_copy_to_stack\n\t" "call " SYMBOL_UNDERSCORE "invoke_copy_to_stack\n\t"