[runtime] Don't store xmm registers where we store other registers.
We store $ebx at $ebp-12: pushl %ebx # %ebp-12 so then storing xmm0 at $ebp-24: movaps %xmm0, -24(%ebp) would write 16 bytes between $ebp-24 and $ebp-8, thus overwriting the place where we stored $ebx. So allocate a bit more stack space and store the xmm registers further 16 bytes down.
This commit is contained in:
Родитель
e8e8d6ea43
Коммит
e51c48cda5
|
@ -47,7 +47,7 @@ L_start:
|
|||
jmp L_start # }
|
||||
L_end:
|
||||
|
||||
movaps -24(%ebp), %xmm0
|
||||
movaps -40(%ebp), %xmm1
|
||||
movaps -56(%ebp), %xmm2
|
||||
movaps -72(%ebp), %xmm3
|
||||
movaps -40(%ebp), %xmm0
|
||||
movaps -56(%ebp), %xmm1
|
||||
movaps -72(%ebp), %xmm2
|
||||
movaps -88(%ebp), %xmm3
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Lafterinvoke:
|
||||
addl -16(%ebp), %esp
|
||||
addl $92, %esp
|
||||
addl $96, %esp
|
||||
popl %ebx
|
||||
popl %edi
|
||||
popl %esi
|
||||
|
|
|
@ -20,8 +20,8 @@ Lfunc_begin0:
|
|||
# we need 64 bytes to store xmm0-3, and those 64 bytes need to be 16-byte aligned.
|
||||
# we need 4 bytes to store the result for get_frame_length, which we store in %ebp-16
|
||||
# then 4 more bytes for stack space for the call to get_frame_length (which takes 2 arguments)
|
||||
subl $92, %esp # to store xmm0-3
|
||||
movaps %xmm0, -24(%ebp)
|
||||
movaps %xmm1, -40(%ebp)
|
||||
movaps %xmm2, -56(%ebp)
|
||||
movaps %xmm3, -72(%ebp)
|
||||
subl $96, %esp # to store xmm0-3
|
||||
movaps %xmm0, -40(%ebp)
|
||||
movaps %xmm1, -56(%ebp)
|
||||
movaps %xmm2, -72(%ebp)
|
||||
movaps %xmm3, -88(%ebp)
|
||||
|
|
Загрузка…
Ссылка в новой задаче