[flang-commits] [flang] [llvm] [flang]- Fix for IEEE_IS_NAN sets IEEE_INVALID after inspecting a sNaN (PR #205276)
via flang-commits
flang-commits at lists.llvm.org
Tue Aug 11 04:43:28 PDT 2026
ejose02 wrote:
> According to [LangRef](https://llvm.org/docs/LangRef.html#id1823), `llvm.is.fpclass` "never raises floating-point exceptions". Is there an issue in `llvm.is.fpclass` code generation? What targets are effected by #203818?
@vzakhari ,Thanks for pointing that out. I wasn't aware of the constraint in llvm.is.fpclass codegen.
I initially added a Flang-side workaround, but I have now changed that logicin order to fix the underlying problem: for fcNan, expandIS_FPCLASS lowered to FP self-compares (ucomiss on x86), which can set FE_INVALID on sNaN even though LangRef says the intrinsic never raises FP exceptions.
I've reworked the patch to remove that FP-compare fast path and use the existing integer expansion instead. Flang now keeps the genIsFPClass/llvm.intr.is.fpclass lowering, and is_fpclass.ll expectations are updated accordingly.
https://github.com/llvm/llvm-project/pull/205276
More information about the flang-commits
mailing list