[clang] ff80dc8 - [X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound literals
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 11 08:35:34 PDT 2022
Author: Craig Topper
Date: 2022-06-11T08:34:37-07:00
New Revision: ff80dc85449307d90e5276cd8f41825ace9b8594
URL: https://github.com/llvm/llvm-project/commit/ff80dc85449307d90e5276cd8f41825ace9b8594
DIFF: https://github.com/llvm/llvm-project/commit/ff80dc85449307d90e5276cd8f41825ace9b8594.diff
LOG: [X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound literals
This had previously been fixed, but was lost 4 years ago when __extension__
was removed from many intrinsic macros.
Refixes PR32491.
Added:
Modified:
clang/lib/Headers/f16cintrin.h
Removed:
################################################################################
diff --git a/clang/lib/Headers/f16cintrin.h b/clang/lib/Headers/f16cintrin.h
index 13905e6fb0ec..94a662c1d93a 100644
--- a/clang/lib/Headers/f16cintrin.h
+++ b/clang/lib/Headers/f16cintrin.h
@@ -65,9 +65,9 @@ _cvtsh_ss(unsigned short __a)
/// 011: Truncate \n
/// 1XX: Use MXCSR.RC for rounding
/// \returns The converted 16-bit half-precision float value.
-#define _cvtss_sh(a, imm) \
- ((unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \
- (imm)))[0]))
+#define _cvtss_sh(a, imm) __extension__ ({ \
+ (unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \
+ (imm)))[0]); })
/// Converts a 128-bit vector containing 32-bit float values into a
/// 128-bit vector containing 16-bit half-precision float values.
More information about the cfe-commits
mailing list