Skip to content

Commit 16b9410

Browse files
committed
[X86] Cast to __v4hi instead of __m64 in the implementation of _mm_extract_pi16 and _mm_insert_pi16.
__m64 is a vector of 1 long long. But the builtins these intrinsics are calling expect a vector of 4 shorts. Fixes PR44589
1 parent 5bb8d28 commit 16b9410

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Headers/xmmintrin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,7 @@ void _mm_sfence(void);
21812181
/// 3: Bits [63:48] are copied to the destination.
21822182
/// \returns A 16-bit integer containing the extracted 16 bits of packed data.
21832183
#define _mm_extract_pi16(a, n) \
2184-
(int)__builtin_ia32_vec_ext_v4hi((__m64)a, (int)n)
2184+
(int)__builtin_ia32_vec_ext_v4hi((__v4hi)a, (int)n)
21852185

21862186
/// Copies data from the 64-bit vector of [4 x i16] to the destination,
21872187
/// and inserts the lower 16-bits of an integer operand at the 16-bit offset
@@ -2212,7 +2212,7 @@ void _mm_sfence(void);
22122212
/// \returns A 64-bit integer vector containing the copied packed data from the
22132213
/// operands.
22142214
#define _mm_insert_pi16(a, d, n) \
2215-
(__m64)__builtin_ia32_vec_set_v4hi((__m64)a, (int)d, (int)n)
2215+
(__m64)__builtin_ia32_vec_set_v4hi((__v4hi)a, (int)d, (int)n)
22162216

22172217
/// Compares each of the corresponding packed 16-bit integer values of
22182218
/// the 64-bit integer vectors, and writes the greater value to the

0 commit comments

Comments
 (0)