Fix PPC buildbot break caused by 4c4093e6e39fe6601f9c95a95a6bc242ef648cd5
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Sat, 7 Aug 2021 03:03:44 +0000 (22:03 -0500)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Sat, 7 Aug 2021 03:10:20 +0000 (22:10 -0500)
commit62fe3dcf98d17ea027492fd723dbb9b6dc295761
treee896c4bd58b61c9c60a6c26574842cbba14321db
parent71e71067f3fa621d961e2607f1c8cea7cdce3f9d
Fix PPC buildbot break caused by 4c4093e6e39fe6601f9c95a95a6bc242ef648cd5

This commit adds the isnan intrinsic and provides a default expansion
for it in the SDAG. However, it makes the assumption that types
it operates on are IEEE-compliant types. This is not always the case.
An example of that is PPC "double double" which has a representation
that
- Does not need to conform to IEEE requirements for isnan as it is
  not an IEEE-compliant type
- Does not have a representation that allows for straightforward
  reinterpreting as an integer and use of integer operations

The result was that this commit broke __builtin_isnan for ppc_fp128
making many valid numeric values report a NaN.

This patch simply changes the expansion to always expand to unordered
comparison (regardless of whether FP exceptions are tracked). This
is inline with previous semantics.
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/PowerPC/ppc-fpclass.ll