[PATCH] D108037: [X86] Implement llvm.isnan(x86_fp80) as unordered comparison

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 13 13:38:39 PDT 2021


efriedma added a comment.

In D108037#2943917 <https://reviews.llvm.org/D108037#2943917>, @sivachandra wrote:

> But, one question: why not use `fxam` in all cases?

Because it's more instructions?

> As a solution, this fix changes lowering of the intrinsic. If floating
> point exceptions are ignored, llvm.isnan is lowered into unordered
> comparison, as __buildtin_isnan was implemented earlier. In strictfp
> functions the intrinsic is lowered using FXAM, which does not raise
> exceptions even for signaling NaN, as required by IEEE-754 and C
> standards.

This seems like only half of a solution.  If we actually care about this, we should change the way we check the result of fxam.  ("unsupported" is one of the categories returned by fxam.)

I'm not convinced we care about this, though.  We could probably just say in LangRef that floating-point operations on "unsupported" x86_fp80 values produce poison, and nobody would notice the difference.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108037



More information about the llvm-commits mailing list