simde icon indicating copy to clipboard operation
simde copied to clipboard

_mm256_slli_epi16 to neon failed with Clang18

Open lijing0010 opened this issue 1 year ago • 3 comments

Hi, I'm using SIMDe to convert AVX to neon, and there's _mm256_slli_epi16 in my original code. when compiling with gcc13.2, it's fine. When changed to Clang, it will have compile error.

Seems in gcc13.2, vshlq_n_s16() internally will use __builtin_aarch64_ashlv8hi(), and it's OK. But in Clang, vshlq_n_s16() will use __builtin_neon_vshlq_n_v(), which needs a compile stage constant for the 2nd parameter.

Is there anything I can do for this? or did I miss anything?

lijing0010 avatar Oct 11 '24 09:10 lijing0010

Hello @lijing0010 , can you share the compiler output when it doesn't work?

mr-c avatar Oct 11 '24 11:10 mr-c

something like: error: argument to '__builtin_neon_vshrq_n_v' must be a constant integer 1105 | val1 = _mm256_srli_epi32(val1, iQBits);

on gcc it's fine since it called __builtin_aarch64_ashlv8hi

btw: I'm compiling it on an arm server with ubuntu 24.04 LTS

lijing0010 avatar Oct 12 '24 02:10 lijing0010

_mm256_slli_epi16 also "needs a compile stage constant for the 2nd parameter"...

related: https://github.com/simd-everywhere/simde/issues/905#issuecomment-1286352881

aqrit avatar Oct 30 '24 21:10 aqrit