[llvm] InstCombine: Fold ldexp with constant exponent to fmul (PR #171731)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 11 11:24:59 PST 2025


dtcxzyw wrote:

``` 
   // Start with a normal number high exponent but pass a very low number for
    // exp. The result should be a subnormal number.
    x = NormalFloat(Sign::POS, FPBits::EXP_BIAS, NormalFloat::ONE);
    int exp = -FPBits::MAX_BIASED_EXPONENT - 5;
    T result = func(x, exp);
    FPBits result_bits(result);
    ASSERT_FALSE(result_bits.is_zero());
    // Verify that the result is indeed subnormal.
    ASSERT_EQ(result_bits.get_biased_exponent(), uint16_t(0));
```

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


More information about the llvm-commits mailing list