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

James Y Knight via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 25 12:52:43 PDT 2024


================
@@ -150,8 +150,8 @@ TARGET_BUILTIN(__builtin_ia32_pmovmskb, "iV8c", "ncV:64:", "mmx,sse")
 TARGET_BUILTIN(__builtin_ia32_pmulhuw, "V4sV4sV4s", "ncV:64:", "mmx,sse")
 TARGET_BUILTIN(__builtin_ia32_psadbw, "V4sV8cV8c", "ncV:64:", "mmx,sse")
 TARGET_BUILTIN(__builtin_ia32_pshufw, "V4sV4sIc", "ncV:64:", "mmx,sse")
-TARGET_BUILTIN(__builtin_ia32_vec_ext_v4hi, "iV4sIi", "ncV:64:", "mmx,sse")
-TARGET_BUILTIN(__builtin_ia32_vec_set_v4hi, "V4sV4siIi", "ncV:64:", "mmx,sse")
+TARGET_BUILTIN(__builtin_ia32_vec_ext_v4hi, "sV4sIi", "ncV:64:", "sse")
+TARGET_BUILTIN(__builtin_ia32_vec_set_v4hi, "V4sV4ssIi", "ncV:64:", "sse")
----------------
jyknight wrote:

The only purpose served by the `__builtin_ia32_vec_ext/set` is to emit a diagnostic if the immediate value is out of range. They are, otherwise, generic extract/insert operations, which could be just as well spelled `((__v4hi)a)[n]` and `((__v4hi)a)[n] = d;` -- they do not lower to a target-specific LLVM intrinsic.

This change makes the MMX ones consistent with the rest -- previously the MMX ones _did_ lower to an LLVM intrinsic.

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


More information about the cfe-commits mailing list