[all-commits] [llvm/llvm-project] cdbe56: [X86] Implement llvm.isnan(x86_fp80) as unordered ...

Serge Pavlov via All-commits all-commits at lists.llvm.org
Fri Aug 27 04:09:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cdbe569fb6cd34e83b695485bfc5786d54b89017
      https://github.com/llvm/llvm-project/commit/cdbe569fb6cd34e83b695485bfc5786d54b89017
  Author: Serge Pavlov <sepavloff at gmail.com>
  Date:   2021-08-27 (Fri, 27 Aug 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/x86-fpclass.ll

  Log Message:
  -----------
  [X86] Implement llvm.isnan(x86_fp80) as unordered comparison

x86_fp80 format allows values that do not fit any of IEEE-754 category.
Previously they were recognized by intrinsic __builtin_isnan as NaNs.
Now this intrinsic is implemented using instruction FXAM, which
distinguish between NaNs and unsupported values. It can make some
programs behave differently.

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.

Differential Revision: https://reviews.llvm.org/D108037




More information about the All-commits mailing list