Add __INTEL_COMPILER to _MSC_VER #ifdefs.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Thu, 30 Jan 2014 10:53:37 +0000 (21:53 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Thu, 30 Jan 2014 10:53:41 +0000 (21:53 +1100)
Patch-from: lvqcl <lvqcl.mail@gmail.com>

src/libFLAC/cpu.c
src/libFLAC/stream_encoder_intrin_sse2.c
src/libFLAC/stream_encoder_intrin_ssse3.c

index e15689d..0920317 100644 (file)
@@ -450,7 +450,7 @@ void FLAC__cpu_info(FLAC__CPUInfo *info)
 
 void FLAC__cpu_info_x86(FLAC__uint32 *flags_edx, FLAC__uint32 *flags_ecx)
 {
-#if defined _MSC_VER
+#if defined _MSC_VER || defined __INTEL_COMPILER
        int cpuinfo[4];
        __cpuid(cpuinfo, 1);
        *flags_ecx = cpuinfo[2];
index 9852175..34a66f8 100644 (file)
@@ -70,7 +70,7 @@ void FLAC__precompute_partition_info_sums_intrin_sse2(const FLAC__int32 residual
                                if(e1 > end)
                                        e1 = end; /* try flac -l 1 -b 16 and you'll be here */
 
-                               /* assumption: residual[] is properly aligned so (residual + e1) is properly aligned too and _mm_loadu_si128() is fast*/
+                               /* assumption: residual[] is properly aligned so (residual + e1) is properly aligned too and _mm_loadu_si128() is fast */
                                for( ; residual_sample < e1; residual_sample++)
                                        abs_residual_partition_sum += abs(residual[residual_sample]); /* abs(INT_MIN) is undefined, but if the residual is INT_MIN we have bigger problems */
 
@@ -121,7 +121,7 @@ void FLAC__precompute_partition_info_sums_intrin_sse2(const FLAC__int32 residual
 
                                mm_sum = _mm_add_epi64(mm_sum, _mm_srli_si128(mm_sum, 8));
 #ifdef FLAC__CPU_IA32
-#ifdef _MSC_VER
+#if defined _MSC_VER || defined __INTEL_COMPILER
                                abs_residual_partition_sum += mm_sum.m128i_u64[0];
 #else
                                {
index 7294c55..b858dc7 100644 (file)
@@ -70,7 +70,7 @@ void FLAC__precompute_partition_info_sums_intrin_ssse3(const FLAC__int32 residua
                                if(e1 > end)
                                        e1 = end; /* try flac -l 1 -b 16 and you'll be here */
 
-                               /* assumption: residual[] is properly aligned so (residual + e1) is properly aligned too and _mm_loadu_si128() is fast*/
+                               /* assumption: residual[] is properly aligned so (residual + e1) is properly aligned too and _mm_loadu_si128() is fast */
                                for( ; residual_sample < e1; residual_sample++)
                                        abs_residual_partition_sum += abs(residual[residual_sample]); /* abs(INT_MIN) is undefined, but if the residual is INT_MIN we have bigger problems */
 
@@ -117,7 +117,7 @@ void FLAC__precompute_partition_info_sums_intrin_ssse3(const FLAC__int32 residua
 
                                mm_sum = _mm_add_epi64(mm_sum, _mm_srli_si128(mm_sum, 8));
 #ifdef FLAC__CPU_IA32
-#ifdef _MSC_VER
+#if defined _MSC_VER || defined __INTEL_COMPILER
                                abs_residual_partition_sum += mm_sum.m128i_u64[0];
 #else
                                {