Skip to content

Commit ff80dc8

Browse files
committed
[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.
1 parent 45b278f commit ff80dc8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/Headers/f16cintrin.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ _cvtsh_ss(unsigned short __a)
6565
/// 011: Truncate \n
6666
/// 1XX: Use MXCSR.RC for rounding
6767
/// \returns The converted 16-bit half-precision float value.
68-
#define _cvtss_sh(a, imm) \
69-
((unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \
70-
(imm)))[0]))
68+
#define _cvtss_sh(a, imm) __extension__ ({ \
69+
(unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \
70+
(imm)))[0]); })
7171

7272
/// Converts a 128-bit vector containing 32-bit float values into a
7373
/// 128-bit vector containing 16-bit half-precision float values.

0 commit comments

Comments
 (0)