Skip to content

Commit

Permalink
Win/x64: Fix improper callee save of xmm8-xmm11
Browse files Browse the repository at this point in the history
The x86-64 SIMD accelerations for Huffman encoding used incorrect
stack math to save xmm8-xmm11 on Windows.  This caused TJBench to
always report 1 Mpixel/sec for the compression performance, and it
likely would have caused other application issues as well.
  • Loading branch information
dcommander committed Feb 29, 2016
1 parent 7c202f7 commit 056536f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions simd/jchuff-sse2-64.asm
Expand Up @@ -196,11 +196,11 @@ EXTN(jsimd_huff_encode_one_block_sse2):
lea rsp, [t2]
collect_args
%ifdef WIN64
sub rsp, 4*SIZEOF_XMMWORD
movaps XMMWORD [rsp-3*SIZEOF_XMMWORD], xmm8
movaps XMMWORD [rsp-1*SIZEOF_XMMWORD], xmm8
movaps XMMWORD [rsp-2*SIZEOF_XMMWORD], xmm9
movaps XMMWORD [rsp-1*SIZEOF_XMMWORD], xmm10
movaps XMMWORD [rsp-0*SIZEOF_XMMWORD], xmm11
movaps XMMWORD [rsp-3*SIZEOF_XMMWORD], xmm10
movaps XMMWORD [rsp-4*SIZEOF_XMMWORD], xmm11
sub rsp, 4*SIZEOF_XMMWORD
%endif
push rbx

Expand Down Expand Up @@ -344,10 +344,10 @@ EXTN(jsimd_huff_encode_one_block_sse2):

pop rbx
%ifdef WIN64
movaps xmm8, XMMWORD [rsp-3*SIZEOF_XMMWORD]
movaps xmm9, XMMWORD [rsp-2*SIZEOF_XMMWORD]
movaps xmm10, XMMWORD [rsp-1*SIZEOF_XMMWORD]
movaps xmm11, XMMWORD [rsp-0*SIZEOF_XMMWORD]
movaps xmm11, XMMWORD [rsp+0*SIZEOF_XMMWORD]
movaps xmm10, XMMWORD [rsp+1*SIZEOF_XMMWORD]
movaps xmm9, XMMWORD [rsp+2*SIZEOF_XMMWORD]
movaps xmm8, XMMWORD [rsp+3*SIZEOF_XMMWORD]
add rsp, 4*SIZEOF_XMMWORD
%endif
uncollect_args
Expand Down

0 comments on commit 056536f

Please sign in to comment.