[PATCH] D86605: [PowerPC] Expand constrained ppc_fp128 to i32 conversion

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 08:24:33 PDT 2020


uweigand added a comment.

The algorithm used in the unsigned case isn't strict-safe.   However, this is exactly the same algorithm that is also used in TargetLowering::expandFP_TO_UINT, where is has been made properly strict-safe in the meantime.

You should simply copy that algorithm here.  The only difference is that there we target i64, while here we target i32, so the constants have to be updated accordingly.

In the signed case, the only issue is see is that PPCISD::FADDRTZ might throw an exception, and we therefore should be using a strict variant of it here (and chain it in accordingly).


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

https://reviews.llvm.org/D86605



More information about the llvm-commits mailing list