diff options
author | Collin Funk <collin.funk1@gmail.com> | 2024-06-10 06:36:47 +0000 |
---|---|---|
committer | liuhongt <hongtao.liu@intel.com> | 2024-06-23 14:48:41 +0800 |
commit | 4c957d7ba84d8bbce6e778048f38e92ef71806c8 (patch) | |
tree | 5891c1201225b0994fbcf9fcd486ffb6e3ae7a8f /gcc | |
parent | 77f3b3419d476e90a2b82dff2204466aba3b9c2c (diff) | |
download | gcc-4c957d7ba84d8bbce6e778048f38e92ef71806c8.zip gcc-4c957d7ba84d8bbce6e778048f38e92ef71806c8.tar.gz gcc-4c957d7ba84d8bbce6e778048f38e92ef71806c8.tar.bz2 |
AVX-512: Pacify -Wshift-overflow=2. [PR115409]
A shift of 31 on a signed int is undefined behavior. Since unsigned
int is 32-bits wide this change fixes it and silences the warning.
gcc/ChangeLog:
PR target/115409
* config/i386/avx512fp16intrin.h (_mm512_conj_pch): Make the
constant unsigned before shifting.
* config/i386/avx512fp16vlintrin.h (_mm256_conj_pch): Likewise.
(_mm_conj_pch): Likewise.
Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/i386/avx512fp16intrin.h | 2 | ||||
-rw-r--r-- | gcc/config/i386/avx512fp16vlintrin.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/gcc/config/i386/avx512fp16intrin.h b/gcc/config/i386/avx512fp16intrin.h index f86050b..1869a92 100644 --- a/gcc/config/i386/avx512fp16intrin.h +++ b/gcc/config/i386/avx512fp16intrin.h @@ -3355,7 +3355,7 @@ extern __inline __m512h __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_conj_pch (__m512h __A) { - return (__m512h) _mm512_xor_epi32 ((__m512i) __A, _mm512_set1_epi32 (1<<31)); + return (__m512h) _mm512_xor_epi32 ((__m512i) __A, _mm512_set1_epi32 (1U<<31)); } extern __inline __m512h diff --git a/gcc/config/i386/avx512fp16vlintrin.h b/gcc/config/i386/avx512fp16vlintrin.h index a1e1cb5..405a06b 100644 --- a/gcc/config/i386/avx512fp16vlintrin.h +++ b/gcc/config/i386/avx512fp16vlintrin.h @@ -181,7 +181,7 @@ extern __inline __m256h __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_conj_pch (__m256h __A) { - return (__m256h) _mm256_xor_epi32 ((__m256i) __A, _mm256_avx512_set1_epi32 (1<<31)); + return (__m256h) _mm256_xor_epi32 ((__m256i) __A, _mm256_avx512_set1_epi32 (1U<<31)); } extern __inline __m256h @@ -209,7 +209,7 @@ extern __inline __m128h __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_conj_pch (__m128h __A) { - return (__m128h) _mm_xor_epi32 ((__m128i) __A, _mm_avx512_set1_epi32 (1<<31)); + return (__m128h) _mm_xor_epi32 ((__m128i) __A, _mm_avx512_set1_epi32 (1U<<31)); } extern __inline __m128h |