[flang-commits] [flang] [llvm] [flang] Fix wrong result for exponentiation when denormal is expected (PR #205262)
via flang-commits
flang-commits at lists.llvm.org
Thu Oct 22 00:30:44 PDT 2026
ejose02 wrote:
> Overall LGTM. Both the runtime and folder changes make sense, and I was able to validate that they return the correct values.
>
> The PR description and first commit message are out of date with respect to the updated code. If they're going to be part of the squashed merge, it would be nice to have those updated.
>
> AI pointed out some additional tests that would more fully exemplify the cases this fixes:
>
> > A few extra checks would pin down the cases this fixes: a negative base with an odd exponent (`(-2.0_4)**(-133)`), the smallest subnormal and the rounding edge (`2.0_4**(-149)` and `2.0_4**(-150)`), and one non-power-of-two base so the `1/base` rounding is exercised: `5.0_4**(-64)` for the folded test (`3.0_4**(-88)` would not exercise the folder retry, since it is already folded correctly without this PR), and `3.0_4**(-88)` is a good case for the runtime test. On the runtime side, `FPow8k` and `FPow8i` with the most negative exponent would round it out.
Thanks for the review. I have updated the test as well as PR description.
https://github.com/llvm/llvm-project/pull/205262
More information about the flang-commits
mailing list