================ @@ -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]; ---------------- RKSimon wrote:
Does this work consistently? I haven't properly compared the final asm at different -O levels. ``` float _cvtsh_ss(unsigned short __a) { return (float)__builtin_bit_cast(_Float16, __a); } ``` https://github.com/llvm/llvm-project/pull/152911 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits