[clang] [X86][Clang] Support constexpr evaluation of cvtpd2ps intrinsics (PR #169980)
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 30 08:38:05 PST 2025
================
@@ -0,0 +1,479 @@
+// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown -target-feature +avx -target-feature +avx512f -target-feature +avx512vl -verify %s
+
+#define __MM_MALLOC_H
+#include <immintrin.h>
+
+namespace Test_mm_cvtsd_ss {
+namespace OK {
+constexpr __m128 a = { 9.0f, 5.0f, 6.0f, 7.0f };
+constexpr __m128d b = { -1.0, 42.0 };
+constexpr __m128 r = _mm_cvtsd_ss(a, b);
+static_assert(r[0] == -1.0f && r[1] == 5.0f && r[2] == 6.0f && r[3] == 7.0f, "");
----------------
RKSimon wrote:
These successful tests need to be placed inside "clang\test\CodeGen\X86\sse2-builtins.c" etc. - using the TEST_CONSTEXPR helper macro
https://github.com/llvm/llvm-project/pull/169980
More information about the cfe-commits
mailing list