intel / ARM_NEON_2_x86_SSE

The platform independent header allowing to compile any C/C++ code containing ARM NEON intrinsic functions for x86 target systems using SIMD up to AVX2 intrinsic functions
Other
430 stars 149 forks source link

Signed argument to _mm_set1_epi8/16/32 #59

Closed Pibben closed 2 years ago

Pibben commented 2 years ago

_mm_set1_epi8/16/32 take signed integer arguments, so the cast to unsigned in NEON_2_SSE.h causes -Wsign-conversion warnings with GCC.

#define vdupq_n_u8(value) _mm_set1_epi8((uint8_t) (value))
#define vdupq_n_u16(value) _mm_set1_epi16((uint16_t) (value))
#define vdupq_n_u32(value) _mm_set1_epi32((uint32_t) (value))

should be changed to

#define vdupq_n_u8(value) _mm_set1_epi8((int8_t) (value))
#define vdupq_n_u16(value) _mm_set1_epi16((int16_t) (value))
#define vdupq_n_u32(value) _mm_set1_epi32((int32_t) (value))
Zvictoria commented 2 years ago

Pushed in, thanks :)