[clang] [X86][Clang] Support constexpr evaluation of cvtpd2ps intrinsics (PR #169980)
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 1 01:23:15 PST 2025
================
@@ -207,9 +207,8 @@ _mm512_undefined(void)
return (__m512)__builtin_ia32_undef512();
}
-static __inline__ __m512 __DEFAULT_FN_ATTRS512
-_mm512_undefined_ps(void)
-{
+static __inline__ __m512 __DEFAULT_FN_ATTRS512_CONSTEXPR
+_mm512_undefined_ps(void) {
----------------
RKSimon wrote:
No, the _mm*_undefined_ps intrinsics are there to indicate there are undefined elements and I'm very reluctant to allow them to canonicalize to a fixed constant value - I do not want to be in a position where we start getting a lot of reports about constexpr and runtime code giving different results. For now I think just focusing on the SSE/AVX builtins is the way to go - we have various other avx512 intrinsics that are still causing trouble so adding these to the pile isn't a problem.
But _mm512_cvtpd_ps can be addressed by replacing _mm256_undefined_ps with _mm256_setzero_ps which should help at least some cases.
https://github.com/llvm/llvm-project/pull/169980
More information about the cfe-commits
mailing list