[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 04:40:11 PDT 2025


moorabbit wrote:

I couldn't get __builtin_convertvector to emit an [fpext](https://llvm.org/docs/LangRef.html#fpext-to-instruction) instruction instead of an [sitofp](https://llvm.org/docs/LangRef.html#sitofp-to-instruction) when converting a 16-bit half-precision float into a 32-bit float.

I tried to solve this by defining __v4hf and __v8hf types (vectors of 4 and 8 half-precision floats) and casting the operand of __builtin_convertvector to one of them, so that Clang recognizes the vector elements as floating types rather than integers.

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


More information about the cfe-commits mailing list