[PATCH] D54749: Saturating float to int casts.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 12:01:37 PDT 2020


efriedma added a comment.

> At least for the IEEE formats, you should be able to just destructure the bit-pattern of the float, right? Normalize and do some extends and shifts.

If we're going down that path, maybe simpler to just mess with the float scaling factor.  If a float is close to the largest finite float, in IEEE formats, the fractional part must be zero.  So we can do the float-to-int conversion on the unscaled float, and scale the resulting integer.  Probably faster than trying to explicitly destructure a float.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D54749



More information about the llvm-commits mailing list