[clang] [Headers][X86] Fix incorrect macro definitions for non-constexpr (PR #153060)
Bhasawut Singhaphan via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 11 11:01:41 PDT 2025
https://github.com/markbhasawut created https://github.com/llvm/llvm-project/pull/153060
While working on PR #152910, I discovered some incorrectly defined `__DEFAULT_FN_ATTRS*_CONSTEXPR` macros for non-constexpr contexts.
>From 4924552f7b1c585a613943ab65050e73e6525bb4 Mon Sep 17 00:00:00 2001
From: Bhasawut Singhaphan <bhasawut at gmail.com>
Date: Tue, 12 Aug 2025 00:34:52 +0700
Subject: [PATCH] [Headers][X86] Fix incorrect macro definitions for
non-constexpr
While working on PR #152910, I discovered some incorrectly defined
`__DEFAULT_FN_ATTRS*_CONSTEXPR` macros for non-constexpr contexts.
---
clang/lib/Headers/avx512fintrin.h | 4 ++--
clang/lib/Headers/avxintrin.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/clang/lib/Headers/avx512fintrin.h b/clang/lib/Headers/avx512fintrin.h
index b3e9efdd519ab..9fc1df3acd3d0 100644
--- a/clang/lib/Headers/avx512fintrin.h
+++ b/clang/lib/Headers/avx512fintrin.h
@@ -180,9 +180,9 @@ typedef enum
#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512 constexpr
#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
#else
-#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS128
+#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
#define __DEFAULT_FN_ATTRS512_CONSTEXPR __DEFAULT_FN_ATTRS512
-#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS
+#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
#endif
/* Create vectors with repeated elements */
diff --git a/clang/lib/Headers/avxintrin.h b/clang/lib/Headers/avxintrin.h
index 5a6d48bc246e3..b8cfaee7cfb46 100644
--- a/clang/lib/Headers/avxintrin.h
+++ b/clang/lib/Headers/avxintrin.h
@@ -70,8 +70,8 @@ typedef __bf16 __m256bh __attribute__((__vector_size__(32), __aligned__(32)));
#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128 constexpr
#else
-#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS128
-#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS
+#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
+#define __DEFAULT_FN_ATTRS128_CONSTEXPR __DEFAULT_FN_ATTRS128
#endif
/* Arithmetic */
More information about the cfe-commits
mailing list