[clang] [llvm] Clang: convert `__m64` intrinsics to unconditionally use SSE2 instead of MMX. (PR #96540)

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 24 23:28:56 PDT 2024


================
@@ -124,10 +143,11 @@ _mm_cvtm64_si64(__m64 __m)
 ///    written to the upper 32 bits of the result.
 /// \returns A 64-bit integer vector of [8 x i8] containing the converted
 ///    values.
-static __inline__ __m64 __DEFAULT_FN_ATTRS
+static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
 _mm_packs_pi16(__m64 __m1, __m64 __m2)
 {
-    return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
+    return __extract2_32(__builtin_ia32_packsswb128((__v8hi)__anyext128(__m1),
----------------
phoebewang wrote:

Should it be better to shuffle `__m1` and `__m2` first and then `__trunc64`? The same for below.

https://github.com/llvm/llvm-project/pull/96540


More information about the cfe-commits mailing list