More generic version of MSVC bug workaround
authorErik de Castro Lopo <erikd@mega-nerd.com>
Sun, 6 May 2018 05:25:11 +0000 (15:25 +1000)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Sun, 6 May 2018 05:25:14 +0000 (15:25 +1000)
This is an updtate to the fix for an MSVC 2015 bug in 94a61241b0.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

src/libFLAC/stream_encoder_intrin_avx2.c
src/libFLAC/stream_encoder_intrin_sse2.c
src/libFLAC/stream_encoder_intrin_ssse3.c

index 12591f0..265e6fe 100644 (file)
@@ -86,8 +86,8 @@ 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)
+/* workaround for MSVC bugs (at least versions 2015 and 2017 are affected) */
+#if (defined _MSC_VER) && (defined FLAC__CPU_X86_64)
                                abs_residual_partition_sums[partition] &= 0xFFFFFFFF; /**/
 #endif
                        }
index 6c16d2e..ed94ec3 100644 (file)
@@ -100,8 +100,8 @@ 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)
+/* workaround for MSVC bugs (at least versions 2015 and 2017 are affected) */
+#if (defined _MSC_VER) && (defined FLAC__CPU_X86_64)
                                abs_residual_partition_sums[partition] &= 0xFFFFFFFF;
 #endif
                        }
index 1e87d83..b5996f7 100644 (file)
@@ -89,8 +89,8 @@ 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)
+/* workaround for MSVC bugs (at least versions 2015 and 2017 are affected) */
+#if (defined _MSC_VER) && (defined FLAC__CPU_X86_64)
                                abs_residual_partition_sums[partition] &= 0xFFFFFFFF;
 #endif
                        }