[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

Jonas Paulsson via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 7 09:48:08 PDT 2025


JonPsson1 wrote:

libcalls emission:

For the uint->fp, SelectionDAGLegalize::ExpandLegalINT_TO_FP() has an assertion before the last attempt involving converting to SINT_TO_FP, that makes sure that this optimization is possible. If I change that to return SDValue() instead of asserting, these conversions now get a libcall emitted by common code.

However, with fp->uint we get a working expansion but with two libcalls and a branch-sequence, instead of a single libcall (e.g. fp-conv-20.ll/@f13/-z13). Since there are specialized libcalls available, it seems this wouldn't be acceptable, so keeping the
libcalls emission in SystemZ after all.

> This seems to be more suitable for a DAGCombiner rule as it is really a performance optimization. This could also be done as a separate patch (for all the types).

Removed the lowering that removed the fp_round of fp128, to be followed up instead along with float and double.

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


More information about the cfe-commits mailing list