Skip to content
  • Erik de Castro Lopo's avatar
    libFLAC: Add a workaround for a bug in MSVC2105 update2 · 94a61241
    Erik de Castro Lopo authored
    MSVC2105 update2 compiles the C code:
    
        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.
    
    Patch-from: lvqcl <lvqcl.mail@gmail.com>
    94a61241