[flac-dev] [PATCH] MSVC2015U2 workaround, version 2

lvqcl lvqcl.mail at gmail.com
Mon May 2 19:11:18 UTC 2016


Here's a new version of a patch that fixes a problem with MSVC2105 update2,
but it doesn't disable any optimization, so the resulting encoding
performance should be almost unaffected by this workaround.


MSVC compiles

     abs_residual_partition_sums[partition] = (FLAC__uint32)_mm_cvtsi128_si32(mm_sum);

into this:

     movq    QWORD PTR [rsi], xmm2

while it should be

     movd    eax, xmm2
     mov     QWORD PTR [rsi], rax

With this patch, MSVC emits

     movq    QWORD PTR [rsi], xmm2
     mov     DWORD PTR [rsi+4], r9d

so the price of this workaround is 1 extra write instruction per partition.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msvc_bug_v2.patch
Type: application/octet-stream
Size: 2700 bytes
Desc: not available
URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20160502/ea751800/attachment.obj>


More information about the flac-dev mailing list