[llvm-branch-commits] [llvm] [InstCombine] Fold exp2(uitofp iN x) to ldexp when N equals the width of int (PR #227380)
Eric Ross via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Sep 30 08:48:45 PDT 2026
ZERICO2005 wrote:
> It always holds today (Emax + 1 <= 16384), but it keeps the fold safe if a wider FP type is ever added. :-)
For `float128`/`float80`, that value should be `16384 + 16384 + 112 = 32880` or somewhere close to there. This is because you have to consider what exponent is needed for `ldexp(FLT128_TRUE_MIN, exponent)` to guarantee overflow.
https://github.com/llvm/llvm-project/pull/227380
More information about the llvm-branch-commits
mailing list