Commit 6abc4803 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

stream_encoder_intrin_sse[23].c : Optimize of int32 -> uint64 conversion.

Optimizes int32 -> uint64 conversion by doing zero extension (int32 ->
uint32 -> uint64) instead of sign extension (int32 -> int64 -> uint64).

Patch-from: lvqcl <lvqcl.mail@gmail.com>
parent 97bcc6f5
......@@ -95,7 +95,7 @@ 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] = _mm_cvtsi128_si32(mm_sum);
abs_residual_partition_sums[partition] = (FLAC__uint32)_mm_cvtsi128_si32(mm_sum);
}
}
else { /* have to pessimistically use 64 bits for accumulator */
......
......@@ -89,7 +89,7 @@ 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] = _mm_cvtsi128_si32(mm_sum);
abs_residual_partition_sums[partition] = (FLAC__uint32)_mm_cvtsi128_si32(mm_sum);
}
}
else { /* have to pessimistically use 64 bits for accumulator */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment