[PATCH] D62023: GlobalISel: Implement lower for S64->S32 [SU]ITOFP

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 13:30:16 PDT 2019


efriedma added a comment.

> There is a second expansion in LegalizeDAG which involves temporary stack slots

To clarify, LegalizeDAG combined with TargetLowering have the following lowerings:

1. UINT_TO_FP i64->f32, in TargetLowering::expandUINT_TO_FP.
2. UINT_TO_FP i64->f64, in TargetLowering::expandUINT_TO_FP.
3. SINT_TO_FP from i32->any float, using f64 as an intermediate type, in SelectionDAGLegalize::ExpandLegalINT_TO_FP
4. UINT_TO_FP from i32->any float, using f64 as an intermediate type, in SelectionDAGLegalize::ExpandLegalINT_TO_FP
5. UINT_TO_FP on top of an SINT_TO_FP with the same source/destination types, in SelectionDAGLegalize::ExpandLegalINT_TO_FP.  (It's not obvious to me that this lowering actually rounds correctly, but I can't figure out how to trigger it, anyway.)
6. Promoting the integer operand of an XINT_TO_FP to a larger type.



================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2993
+    // reasonable if the target doesn't have CTLZ. If SITOFP also needs
+    // expansion, it will probably be worse.
+
----------------
Would it make sense to factor this out into a separate function with an appropriate name, so we don't have to modify that function when other lowerings are implemented?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62023/new/

https://reviews.llvm.org/D62023





More information about the llvm-commits mailing list