mirror of https://github.com/xiph/flac
libFLAC: Add a workaround for a bug in MSVC2105 update2
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>
This commit is contained in:
parent
387992bd64
commit
94a61241b0
|
@ -84,6 +84,10 @@ void FLAC__precompute_partition_info_sums_intrin_avx2(const FLAC__int32 residual
|
|||
sum128 = _mm_hadd_epi32(sum128, sum128);
|
||||
sum128 = _mm_hadd_epi32(sum128, sum128);
|
||||
abs_residual_partition_sums[partition] = (FLAC__uint32)_mm_cvtsi128_si32(sum128);
|
||||
/* workaround for a bug in MSVC2015U2 - see https://connect.microsoft.com/VisualStudio/feedback/details/2659191/incorrect-code-generation-for-x86-64 */
|
||||
#if (defined _MSC_VER) && (_MSC_FULL_VER == 190023918) && (defined FLAC__CPU_X86_64)
|
||||
abs_residual_partition_sums[partition] &= 0xFFFFFFFF; /**/
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else { /* have to pessimistically use 64 bits for accumulator */
|
||||
|
|
|
@ -98,6 +98,10 @@ void FLAC__precompute_partition_info_sums_intrin_sse2(const FLAC__int32 residual
|
|||
mm_sum = _mm_add_epi32(mm_sum, _mm_srli_si128(mm_sum, 8));
|
||||
mm_sum = _mm_add_epi32(mm_sum, _mm_srli_si128(mm_sum, 4));
|
||||
abs_residual_partition_sums[partition] = (FLAC__uint32)_mm_cvtsi128_si32(mm_sum);
|
||||
/* workaround for a bug in MSVC2015U2 - see https://connect.microsoft.com/VisualStudio/feedback/details/2659191/incorrect-code-generation-for-x86-64 */
|
||||
#if (defined _MSC_VER) && (_MSC_FULL_VER == 190023918) && (defined FLAC__CPU_X86_64)
|
||||
abs_residual_partition_sums[partition] &= 0xFFFFFFFF;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else { /* have to pessimistically use 64 bits for accumulator */
|
||||
|
|
|
@ -87,6 +87,10 @@ void FLAC__precompute_partition_info_sums_intrin_ssse3(const FLAC__int32 residua
|
|||
mm_sum = _mm_hadd_epi32(mm_sum, mm_sum);
|
||||
mm_sum = _mm_hadd_epi32(mm_sum, mm_sum);
|
||||
abs_residual_partition_sums[partition] = (FLAC__uint32)_mm_cvtsi128_si32(mm_sum);
|
||||
/* workaround for a bug in MSVC2015U2 - see https://connect.microsoft.com/VisualStudio/feedback/details/2659191/incorrect-code-generation-for-x86-64 */
|
||||
#if (defined _MSC_VER) && (_MSC_FULL_VER == 190023918) && (defined FLAC__CPU_X86_64)
|
||||
abs_residual_partition_sums[partition] &= 0xFFFFFFFF;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else { /* have to pessimistically use 64 bits for accumulator */
|
||||
|
|
Loading…
Reference in New Issue