diff --git a/clang/lib/Headers/avx512bwintrin.h b/clang/lib/Headers/avx512bwintrin.h --- a/clang/lib/Headers/avx512bwintrin.h +++ b/clang/lib/Headers/avx512bwintrin.h @@ -1506,7 +1506,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_slli_epi16(__m512i __A, unsigned int __B) { - return (__m512i)__builtin_ia32_psllwi512((__v32hi)__A, __B); + return (__m512i)__builtin_ia32_psllwi512((__v32hi)__A, (int)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS512 @@ -1598,7 +1598,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_srai_epi16(__m512i __A, unsigned int __B) { - return (__m512i)__builtin_ia32_psrawi512((__v32hi)__A, __B); + return (__m512i)__builtin_ia32_psrawi512((__v32hi)__A, (int)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS512 @@ -1643,7 +1643,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_srli_epi16(__m512i __A, unsigned int __B) { - return (__m512i)__builtin_ia32_psrlwi512((__v32hi)__A, __B); + return (__m512i)__builtin_ia32_psrlwi512((__v32hi)__A, (int)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS512 @@ -1659,7 +1659,7 @@ _mm512_maskz_srli_epi16(__mmask32 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, - (__v32hi)_mm512_srli_epi16(__A, __B), + (__v32hi)_mm512_srli_epi16(__A, (unsigned int)__B), (__v32hi)_mm512_setzero_si512()); } diff --git a/clang/lib/Headers/avx512fintrin.h b/clang/lib/Headers/avx512fintrin.h --- a/clang/lib/Headers/avx512fintrin.h +++ b/clang/lib/Headers/avx512fintrin.h @@ -1780,7 +1780,7 @@ { return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, _MM_FROUND_FLOOR, - (__v16sf) __A, -1, + (__v16sf) __A, (unsigned short)-1, _MM_FROUND_CUR_DIRECTION); } @@ -1798,7 +1798,7 @@ { return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, _MM_FROUND_FLOOR, - (__v8df) __A, -1, + (__v8df) __A, (unsigned char)-1, _MM_FROUND_CUR_DIRECTION); } @@ -1825,7 +1825,7 @@ { return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, _MM_FROUND_CEIL, - (__v16sf) __A, -1, + (__v16sf) __A, (unsigned short)-1, _MM_FROUND_CUR_DIRECTION); } @@ -1834,7 +1834,7 @@ { return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, _MM_FROUND_CEIL, - (__v8df) __A, -1, + (__v8df) __A, (unsigned char)-1, _MM_FROUND_CUR_DIRECTION); } @@ -5117,7 +5117,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_slli_epi32(__m512i __A, unsigned int __B) { - return (__m512i)__builtin_ia32_pslldi512((__v16si)__A, __B); + return (__m512i)__builtin_ia32_pslldi512((__v16si)__A, (int)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS512 @@ -5139,7 +5139,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_slli_epi64(__m512i __A, unsigned int __B) { - return (__m512i)__builtin_ia32_psllqi512((__v8di)__A, __B); + return (__m512i)__builtin_ia32_psllqi512((__v8di)__A, (int)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS512 @@ -5161,7 +5161,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_srli_epi32(__m512i __A, unsigned int __B) { - return (__m512i)__builtin_ia32_psrldi512((__v16si)__A, __B); + return (__m512i)__builtin_ia32_psrldi512((__v16si)__A, (int)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS512 @@ -5183,7 +5183,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_srli_epi64(__m512i __A, unsigned int __B) { - return (__m512i)__builtin_ia32_psrlqi512((__v8di)__A, __B); + return (__m512i)__builtin_ia32_psrlqi512((__v8di)__A, (int)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS512 @@ -6606,7 +6606,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_srai_epi32(__m512i __A, unsigned int __B) { - return (__m512i)__builtin_ia32_psradi512((__v16si)__A, __B); + return (__m512i)__builtin_ia32_psradi512((__v16si)__A, (int)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS512 @@ -6629,7 +6629,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_srai_epi64(__m512i __A, unsigned int __B) { - return (__m512i)__builtin_ia32_psraqi512((__v8di)__A, __B); + return (__m512i)__builtin_ia32_psraqi512((__v8di)__A, (int)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS512 @@ -9348,7 +9348,7 @@ static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_mask_reduce_and_epi64(__mmask8 __M, __m512i __W) { - __W = _mm512_mask_mov_epi64(_mm512_set1_epi64(~0ULL), __M, __W); + __W = _mm512_mask_mov_epi64(_mm512_set1_epi64(-1LL), __M, __W); return __builtin_reduce_and((__v8di)__W); } @@ -9415,7 +9415,7 @@ static __inline__ int __DEFAULT_FN_ATTRS512 _mm512_mask_reduce_and_epi32( __mmask16 __M, __m512i __W) { - __W = _mm512_mask_mov_epi32(_mm512_set1_epi32(~0U), __M, __W); + __W = _mm512_mask_mov_epi32(_mm512_set1_epi32(-1), __M, __W); return __builtin_reduce_and((__v16si)__W); } @@ -9487,7 +9487,7 @@ static __inline__ unsigned long long __DEFAULT_FN_ATTRS512 _mm512_mask_reduce_min_epu64(__mmask8 __M, __m512i __V) { - __V = _mm512_mask_mov_epi64(_mm512_set1_epi64(~0ULL), __M, __V); + __V = _mm512_mask_mov_epi64(_mm512_set1_epi64(-1LL), __M, __V); return __builtin_reduce_min((__v8du)__V); } static __inline__ int __DEFAULT_FN_ATTRS512 @@ -9530,7 +9530,7 @@ static __inline__ unsigned int __DEFAULT_FN_ATTRS512 _mm512_mask_reduce_min_epu32(__mmask16 __M, __m512i __V) { - __V = _mm512_mask_mov_epi32(_mm512_set1_epi32(~0U), __M, __V); + __V = _mm512_mask_mov_epi32(_mm512_set1_epi32(-1), __M, __V); return __builtin_reduce_min((__v16su)__V); } diff --git a/clang/lib/Headers/avx512vlbf16intrin.h b/clang/lib/Headers/avx512vlbf16intrin.h --- a/clang/lib/Headers/avx512vlbf16intrin.h +++ b/clang/lib/Headers/avx512vlbf16intrin.h @@ -417,7 +417,7 @@ __v4sf __V = {__A, 0, 0, 0}; __v8hi __R = __builtin_ia32_cvtneps2bf16_128_mask( (__v4sf)__V, (__v8hi)_mm_undefined_si128(), (__mmask8)-1); - return __R[0]; + return (__bfloat16)__R[0]; } /// Convert Packed BF16 Data to Packed float Data. diff --git a/clang/lib/Headers/avx512vlbwintrin.h b/clang/lib/Headers/avx512vlbwintrin.h --- a/clang/lib/Headers/avx512vlbwintrin.h +++ b/clang/lib/Headers/avx512vlbwintrin.h @@ -1942,7 +1942,7 @@ _mm_mask_slli_epi16(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, - (__v8hi)_mm_slli_epi16(__A, __B), + (__v8hi)_mm_slli_epi16(__A, (int)__B), (__v8hi)__W); } @@ -1950,7 +1950,7 @@ _mm_maskz_slli_epi16 (__mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, - (__v8hi)_mm_slli_epi16(__A, __B), + (__v8hi)_mm_slli_epi16(__A, (int)__B), (__v8hi)_mm_setzero_si128()); } @@ -1959,7 +1959,7 @@ unsigned int __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, - (__v16hi)_mm256_slli_epi16(__A, __B), + (__v16hi)_mm256_slli_epi16(__A, (int)__B), (__v16hi)__W); } @@ -1967,7 +1967,7 @@ _mm256_maskz_slli_epi16(__mmask16 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, - (__v16hi)_mm256_slli_epi16(__A, __B), + (__v16hi)_mm256_slli_epi16(__A, (int)__B), (__v16hi)_mm256_setzero_si256()); } @@ -2095,7 +2095,7 @@ _mm_mask_srai_epi16(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, - (__v8hi)_mm_srai_epi16(__A, __B), + (__v8hi)_mm_srai_epi16(__A, (int)__B), (__v8hi)__W); } @@ -2103,7 +2103,7 @@ _mm_maskz_srai_epi16(__mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, - (__v8hi)_mm_srai_epi16(__A, __B), + (__v8hi)_mm_srai_epi16(__A, (int)__B), (__v8hi)_mm_setzero_si128()); } @@ -2112,7 +2112,7 @@ unsigned int __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, - (__v16hi)_mm256_srai_epi16(__A, __B), + (__v16hi)_mm256_srai_epi16(__A, (int)__B), (__v16hi)__W); } @@ -2120,7 +2120,7 @@ _mm256_maskz_srai_epi16(__mmask16 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, - (__v16hi)_mm256_srai_epi16(__A, __B), + (__v16hi)_mm256_srai_epi16(__A, (int)__B), (__v16hi)_mm256_setzero_si256()); } diff --git a/clang/lib/Headers/avx512vlintrin.h b/clang/lib/Headers/avx512vlintrin.h --- a/clang/lib/Headers/avx512vlintrin.h +++ b/clang/lib/Headers/avx512vlintrin.h @@ -4525,7 +4525,7 @@ _mm_mask_slli_epi32(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, - (__v4si)_mm_slli_epi32(__A, __B), + (__v4si)_mm_slli_epi32(__A, (int)__B), (__v4si)__W); } @@ -4533,7 +4533,7 @@ _mm_maskz_slli_epi32(__mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, - (__v4si)_mm_slli_epi32(__A, __B), + (__v4si)_mm_slli_epi32(__A, (int)__B), (__v4si)_mm_setzero_si128()); } @@ -4541,7 +4541,7 @@ _mm256_mask_slli_epi32(__m256i __W, __mmask8 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, - (__v8si)_mm256_slli_epi32(__A, __B), + (__v8si)_mm256_slli_epi32(__A, (int)__B), (__v8si)__W); } @@ -4549,7 +4549,7 @@ _mm256_maskz_slli_epi32(__mmask8 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, - (__v8si)_mm256_slli_epi32(__A, __B), + (__v8si)_mm256_slli_epi32(__A, (int)__B), (__v8si)_mm256_setzero_si256()); } @@ -4589,7 +4589,7 @@ _mm_mask_slli_epi64(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, - (__v2di)_mm_slli_epi64(__A, __B), + (__v2di)_mm_slli_epi64(__A, (int)__B), (__v2di)__W); } @@ -4597,7 +4597,7 @@ _mm_maskz_slli_epi64(__mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, - (__v2di)_mm_slli_epi64(__A, __B), + (__v2di)_mm_slli_epi64(__A, (int)__B), (__v2di)_mm_setzero_si128()); } @@ -4605,7 +4605,7 @@ _mm256_mask_slli_epi64(__m256i __W, __mmask8 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, - (__v4di)_mm256_slli_epi64(__A, __B), + (__v4di)_mm256_slli_epi64(__A, (int)__B), (__v4di)__W); } @@ -4613,7 +4613,7 @@ _mm256_maskz_slli_epi64(__mmask8 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, - (__v4di)_mm256_slli_epi64(__A, __B), + (__v4di)_mm256_slli_epi64(__A, (int)__B), (__v4di)_mm256_setzero_si256()); } @@ -4869,7 +4869,7 @@ _mm_mask_srli_epi32(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, - (__v4si)_mm_srli_epi32(__A, __B), + (__v4si)_mm_srli_epi32(__A, (int)__B), (__v4si)__W); } @@ -4877,7 +4877,7 @@ _mm_maskz_srli_epi32(__mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, - (__v4si)_mm_srli_epi32(__A, __B), + (__v4si)_mm_srli_epi32(__A, (int)__B), (__v4si)_mm_setzero_si128()); } @@ -4885,7 +4885,7 @@ _mm256_mask_srli_epi32(__m256i __W, __mmask8 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, - (__v8si)_mm256_srli_epi32(__A, __B), + (__v8si)_mm256_srli_epi32(__A, (int)__B), (__v8si)__W); } @@ -4893,7 +4893,7 @@ _mm256_maskz_srli_epi32(__mmask8 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, - (__v8si)_mm256_srli_epi32(__A, __B), + (__v8si)_mm256_srli_epi32(__A, (int)__B), (__v8si)_mm256_setzero_si256()); } @@ -4933,7 +4933,7 @@ _mm_mask_srli_epi64(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, - (__v2di)_mm_srli_epi64(__A, __B), + (__v2di)_mm_srli_epi64(__A, (int)__B), (__v2di)__W); } @@ -4941,7 +4941,7 @@ _mm_maskz_srli_epi64(__mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, - (__v2di)_mm_srli_epi64(__A, __B), + (__v2di)_mm_srli_epi64(__A, (int)__B), (__v2di)_mm_setzero_si128()); } @@ -4949,7 +4949,7 @@ _mm256_mask_srli_epi64(__m256i __W, __mmask8 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, - (__v4di)_mm256_srli_epi64(__A, __B), + (__v4di)_mm256_srli_epi64(__A, (int)__B), (__v4di)__W); } @@ -4957,7 +4957,7 @@ _mm256_maskz_srli_epi64(__mmask8 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, - (__v4di)_mm256_srli_epi64(__A, __B), + (__v4di)_mm256_srli_epi64(__A, (int)__B), (__v4di)_mm256_setzero_si256()); } @@ -6408,7 +6408,7 @@ _mm_mask_srai_epi32(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, - (__v4si)_mm_srai_epi32(__A, __B), + (__v4si)_mm_srai_epi32(__A, (int)__B), (__v4si)__W); } @@ -6416,7 +6416,7 @@ _mm_maskz_srai_epi32(__mmask8 __U, __m128i __A, unsigned int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, - (__v4si)_mm_srai_epi32(__A, __B), + (__v4si)_mm_srai_epi32(__A, (int)__B), (__v4si)_mm_setzero_si128()); } @@ -6424,7 +6424,7 @@ _mm256_mask_srai_epi32(__m256i __W, __mmask8 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, - (__v8si)_mm256_srai_epi32(__A, __B), + (__v8si)_mm256_srai_epi32(__A, (int)__B), (__v8si)__W); } @@ -6432,7 +6432,7 @@ _mm256_maskz_srai_epi32(__mmask8 __U, __m256i __A, unsigned int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, - (__v8si)_mm256_srai_epi32(__A, __B), + (__v8si)_mm256_srai_epi32(__A, (int)__B), (__v8si)_mm256_setzero_si256()); } @@ -6483,7 +6483,7 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_srai_epi64(__m128i __A, unsigned int __imm) { - return (__m128i)__builtin_ia32_psraqi128((__v2di)__A, __imm); + return (__m128i)__builtin_ia32_psraqi128((__v2di)__A, (int)__imm); } static __inline__ __m128i __DEFAULT_FN_ATTRS128 @@ -6505,7 +6505,7 @@ static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_srai_epi64(__m256i __A, unsigned int __imm) { - return (__m256i)__builtin_ia32_psraqi256((__v4di)__A, __imm); + return (__m256i)__builtin_ia32_psraqi256((__v4di)__A, (int)__imm); } static __inline__ __m256i __DEFAULT_FN_ATTRS256 diff --git a/clang/lib/Headers/bmiintrin.h b/clang/lib/Headers/bmiintrin.h --- a/clang/lib/Headers/bmiintrin.h +++ b/clang/lib/Headers/bmiintrin.h @@ -68,7 +68,7 @@ static __inline__ int __RELAXED_FN_ATTRS _mm_tzcnt_32(unsigned int __X) { - return __builtin_ia32_tzcnt_u32(__X); + return (int)__builtin_ia32_tzcnt_u32(__X); } #define _tzcnt_u32(a) (__tzcnt_u32((a))) @@ -106,7 +106,7 @@ static __inline__ long long __RELAXED_FN_ATTRS _mm_tzcnt_64(unsigned long long __X) { - return __builtin_ia32_tzcnt_u64(__X); + return (long long)__builtin_ia32_tzcnt_u64(__X); } #define _tzcnt_u64(a) (__tzcnt_u64((a))) diff --git a/clang/lib/Headers/cetintrin.h b/clang/lib/Headers/cetintrin.h --- a/clang/lib/Headers/cetintrin.h +++ b/clang/lib/Headers/cetintrin.h @@ -19,7 +19,7 @@ __attribute__((__always_inline__, __nodebug__, __target__("shstk"))) static __inline__ void __DEFAULT_FN_ATTRS _incsspd(int __a) { - __builtin_ia32_incsspd(__a); + __builtin_ia32_incsspd((unsigned int)__a); } #ifdef __x86_64__ @@ -34,7 +34,7 @@ } #else /* __x86_64__ */ static __inline__ void __DEFAULT_FN_ATTRS _inc_ssp(unsigned int __a) { - __builtin_ia32_incsspd((int)__a); + __builtin_ia32_incsspd((unsigned int)__a); } #endif /* __x86_64__ */ diff --git a/clang/lib/Headers/immintrin.h b/clang/lib/Headers/immintrin.h --- a/clang/lib/Headers/immintrin.h +++ b/clang/lib/Headers/immintrin.h @@ -276,20 +276,20 @@ static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) _rdrand16_step(unsigned short *__p) { - return __builtin_ia32_rdrand16_step(__p); + return (int)__builtin_ia32_rdrand16_step(__p); } static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) _rdrand32_step(unsigned int *__p) { - return __builtin_ia32_rdrand32_step(__p); + return (int)__builtin_ia32_rdrand32_step(__p); } #ifdef __x86_64__ static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) _rdrand64_step(unsigned long long *__p) { - return __builtin_ia32_rdrand64_step(__p); + return (int)__builtin_ia32_rdrand64_step(__p); } #endif #endif /* __RDRND__ */ @@ -360,50 +360,50 @@ static __inline__ short __attribute__((__always_inline__, __nodebug__, __target__("movbe"))) _loadbe_i16(void const * __P) { struct __loadu_i16 { - short __v; + unsigned short __v; } __attribute__((__packed__, __may_alias__)); - return __builtin_bswap16(((const struct __loadu_i16*)__P)->__v); + return (short)__builtin_bswap16(((const struct __loadu_i16*)__P)->__v); } static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("movbe"))) _storebe_i16(void * __P, short __D) { struct __storeu_i16 { - short __v; + unsigned short __v; } __attribute__((__packed__, __may_alias__)); - ((struct __storeu_i16*)__P)->__v = __builtin_bswap16(__D); + ((struct __storeu_i16*)__P)->__v = __builtin_bswap16((unsigned short)__D); } static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("movbe"))) _loadbe_i32(void const * __P) { struct __loadu_i32 { - int __v; + unsigned int __v; } __attribute__((__packed__, __may_alias__)); - return __builtin_bswap32(((const struct __loadu_i32*)__P)->__v); + return (int)__builtin_bswap32(((const struct __loadu_i32*)__P)->__v); } static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("movbe"))) _storebe_i32(void * __P, int __D) { struct __storeu_i32 { - int __v; + unsigned int __v; } __attribute__((__packed__, __may_alias__)); - ((struct __storeu_i32*)__P)->__v = __builtin_bswap32(__D); + ((struct __storeu_i32*)__P)->__v = __builtin_bswap32((unsigned int)__D); } #ifdef __x86_64__ static __inline__ long long __attribute__((__always_inline__, __nodebug__, __target__("movbe"))) _loadbe_i64(void const * __P) { struct __loadu_i64 { - long long __v; + unsigned long long __v; } __attribute__((__packed__, __may_alias__)); - return __builtin_bswap64(((const struct __loadu_i64*)__P)->__v); + return (long long)__builtin_bswap64(((const struct __loadu_i64*)__P)->__v); } static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("movbe"))) _storebe_i64(void * __P, long long __D) { struct __storeu_i64 { - long long __v; + unsigned long long __v; } __attribute__((__packed__, __may_alias__)); - ((struct __storeu_i64*)__P)->__v = __builtin_bswap64(__D); + ((struct __storeu_i64*)__P)->__v = __builtin_bswap64((unsigned long long)__D); } #endif #endif /* __MOVBE */ diff --git a/clang/lib/Headers/rdseedintrin.h b/clang/lib/Headers/rdseedintrin.h --- a/clang/lib/Headers/rdseedintrin.h +++ b/clang/lib/Headers/rdseedintrin.h @@ -20,20 +20,20 @@ static __inline__ int __DEFAULT_FN_ATTRS _rdseed16_step(unsigned short *__p) { - return __builtin_ia32_rdseed16_step(__p); + return (int) __builtin_ia32_rdseed16_step(__p); } static __inline__ int __DEFAULT_FN_ATTRS _rdseed32_step(unsigned int *__p) { - return __builtin_ia32_rdseed32_step(__p); + return (int) __builtin_ia32_rdseed32_step(__p); } #ifdef __x86_64__ static __inline__ int __DEFAULT_FN_ATTRS _rdseed64_step(unsigned long long *__p) { - return __builtin_ia32_rdseed64_step(__p); + return (int) __builtin_ia32_rdseed64_step(__p); } #endif diff --git a/clang/lib/Headers/rtmintrin.h b/clang/lib/Headers/rtmintrin.h --- a/clang/lib/Headers/rtmintrin.h +++ b/clang/lib/Headers/rtmintrin.h @@ -29,7 +29,7 @@ static __inline__ unsigned int __DEFAULT_FN_ATTRS _xbegin(void) { - return __builtin_ia32_xbegin(); + return (unsigned int)__builtin_ia32_xbegin(); } static __inline__ void __DEFAULT_FN_ATTRS diff --git a/clang/test/CodeGen/X86/avx512bw-builtins.c b/clang/test/CodeGen/X86/avx512bw-builtins.c --- a/clang/test/CodeGen/X86/avx512bw-builtins.c +++ b/clang/test/CodeGen/X86/avx512bw-builtins.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512bw -emit-llvm -o - -Wall -Werror -Wsign-conversion | FileCheck %s -// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512bw -fno-signed-char -emit-llvm -o - -Wall -Werror -Wsign-conversion | FileCheck %s +// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512bw -emit-llvm -o - -Wall -Werror -Wsystem-headers -Wsign-conversion | FileCheck %s +// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512bw -fno-signed-char -emit-llvm -o - -Wall -Werror -Wsystem-headers -Wsign-conversion | FileCheck %s #include diff --git a/clang/test/CodeGen/X86/rdrand-builtins.c b/clang/test/CodeGen/X86/rdrand-builtins.c --- a/clang/test/CodeGen/X86/rdrand-builtins.c +++ b/clang/test/CodeGen/X86/rdrand-builtins.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -no-opaque-pointers -ffreestanding %s -triple=x86_64-unknown-unknown -target-feature +rdrnd -target-feature +rdseed -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X64 -// RUN: %clang_cc1 -no-opaque-pointers -ffreestanding %s -triple=i386-unknown-unknown -target-feature +rdrnd -target-feature +rdseed -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK +// RUN: %clang_cc1 -no-opaque-pointers -ffreestanding %s -triple=x86_64-unknown-unknown -target-feature +rdrnd -target-feature +rdseed -emit-llvm -o - -Wall -Werror -Wsystem-headers -Wsign-conversion | FileCheck %s --check-prefixes=CHECK,X64 +// RUN: %clang_cc1 -no-opaque-pointers -ffreestanding %s -triple=i386-unknown-unknown -target-feature +rdrnd -target-feature +rdseed -emit-llvm -o - -Wall -Werror -Wsystem-headers -Wsign-conversion | FileCheck %s --check-prefixes=CHECK #include