From e78dea7587bf9bf7220152df8de8c08329a817a6 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 7 Jun 2019 20:24:20 -0700 Subject: [PATCH] (alpha_processing,enc}_sse2: quiet signed conv warnings _mm_set1_epi8() takes a char argument _mm_insert_epi16 takes a short argument from clang-7 integer sanitizer: implicit conversion from type 'int' of value 255 (32-bit, signed) to type 'char' changed the value to -1 (8-bit, signed) implicit conversion from type 'int' of value 33153 (32-bit, signed) to type 'short' changed the value to -32383 (16-bit, signed) Change-Id: Ic88c8ef3d00146d34f53a560582db673f818370d --- src/dsp/alpha_processing_sse2.c | 4 ++-- src/dsp/enc_sse2.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dsp/alpha_processing_sse2.c b/src/dsp/alpha_processing_sse2.c index 76587006..2871c56d 100644 --- a/src/dsp/alpha_processing_sse2.c +++ b/src/dsp/alpha_processing_sse2.c @@ -214,7 +214,7 @@ static void ApplyAlphaMultiply_SSE2(uint8_t* rgba, int alpha_first, // Alpha detection static int HasAlpha8b_SSE2(const uint8_t* src, int length) { - const __m128i all_0xff = _mm_set1_epi8(0xff); + const __m128i all_0xff = _mm_set1_epi8((char)0xff); int i = 0; for (; i + 16 <= length; i += 16) { const __m128i v = _mm_loadu_si128((const __m128i*)(src + i)); @@ -228,7 +228,7 @@ static int HasAlpha8b_SSE2(const uint8_t* src, int length) { static int HasAlpha32b_SSE2(const uint8_t* src, int length) { const __m128i alpha_mask = _mm_set1_epi32(0xff); - const __m128i all_0xff = _mm_set1_epi8(0xff); + const __m128i all_0xff = _mm_set1_epi8((char)0xff); int i = 0; // We don't know if we can access the last 3 bytes after the last alpha // value 'src[4 * length - 4]' (because we don't know if alpha is the first diff --git a/src/dsp/enc_sse2.c b/src/dsp/enc_sse2.c index 7b3f142c..b2e78ed9 100644 --- a/src/dsp/enc_sse2.c +++ b/src/dsp/enc_sse2.c @@ -777,7 +777,7 @@ static WEBP_INLINE void VR4_SSE2(uint8_t* dst, const __m128i ABCD0 = _mm_srli_si128(XABCD, 1); const __m128i abcd = _mm_avg_epu8(XABCD, ABCD0); const __m128i _XABCD = _mm_slli_si128(XABCD, 1); - const __m128i IXABCD = _mm_insert_epi16(_XABCD, I | (X << 8), 0); + const __m128i IXABCD = _mm_insert_epi16(_XABCD, (short)(I | (X << 8)), 0); const __m128i avg1 = _mm_avg_epu8(IXABCD, ABCD0); const __m128i lsb = _mm_and_si128(_mm_xor_si128(IXABCD, ABCD0), one); const __m128i avg2 = _mm_subs_epu8(avg1, lsb);