Re: Did clang 14 lose some intrinsics support?

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Sun, 25 Sep 2022 19:02:08 UTC
Christian Weisgerber <naddy@mips.inka.de> writes:

> Did we lose support for SSSE3 and AVX2 intrinsics on amd64 with
> clang 14?

__builtin_* appear unstable unlike _mm* intrinsics. Clang 15 seems
to hide more but I'm not sure about the cause (need bisecting).

===> clang version 15.0.1
#define SSE2_SUPPORTED 1
#define SSE_SUPPORTED 1

===> clang version 15.0.1 with -march=native
#define AVX_SUPPORTED 1
#define FMA_SUPPORTED 1
#define SSE2_SUPPORTED 1
#define SSE4_1_SUPPORTED 1
#define SSE_SUPPORTED 1

> #if __has_builtin(__builtin_ia32_pabsd128)
>   #define SSSE3_SUPPORTED 1
> #endif
[...]
> #if __has_builtin(__builtin_ia32_pabsd256)
>   #define AVX2_SUPPORTED 1
> #endif

See https://github.com/llvm/llvm-project/commit/e5147f82e1cb

- Instead of __builtin_ia32_pabsd128 maybe use _mm_abs_epi32
- Instead of __builtin_ia32_pabsd256 maybe use _mm256_abs_epi32