[clang] [Clang][X86] Replace F16C `vcvtph2ps/256` intrinsics with `(convert|shuffle)vector` builtins (PR #152911)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 10 06:08:02 PDT 2025
================
@@ -39,7 +39,8 @@ static __inline float __DEFAULT_FN_ATTRS128
_cvtsh_ss(unsigned short __a)
{
__v8hi __v = {(short)__a, 0, 0, 0, 0, 0, 0, 0};
- __v4sf __r = __builtin_ia32_vcvtph2ps(__v);
+ __v4hi __w = __builtin_shufflevector(__v, __v, 0, 1, 2, 3);
+ __v4sf __r = __builtin_convertvector((__v4hf)__w, __v4sf);
return __r[0];
----------------
moorabbit wrote:
Thx, LGTM: https://godbolt.org/z/Pcr7aYeKE.
I wasn't aware of the builtin.
https://github.com/llvm/llvm-project/pull/152911
More information about the cfe-commits
mailing list