Skip to content

Commit d2cb189

Browse files
committed
[X86] Use a do {} while (0) in the _MM_EXTRACT_FLOAT implementation.
Previously we just used {}, but that doesn't work in situations like this. if (1) _MM_EXTRACT_FLOAT(d, x, n); else ... The semicolon would terminate the if.
1 parent 73c4c32 commit d2cb189

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Headers/smmintrin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ _mm_max_epu32 (__m128i __V1, __m128i __V2)
871871
/* Miscellaneous insert and extract macros. */
872872
/* Extract a single-precision float from X at index N into D. */
873873
#define _MM_EXTRACT_FLOAT(D, X, N) \
874-
{ (D) = __builtin_ia32_vec_ext_v4sf((__v4sf)(__m128)(X), (int)(N)); }
874+
do { (D) = __builtin_ia32_vec_ext_v4sf((__v4sf)(__m128)(X), (int)(N)); } while (0)
875875

876876
/* Or together 2 sets of indexes (X and Y) with the zeroing bits (Z) to create
877877
an index suitable for _mm_insert_ps. */

0 commit comments

Comments
 (0)