Commit Graph

3 Commits

Author SHA1 Message Date
Craig Topper a1ae3c6ac9 [RISCV][LegalizeDAG] Expand SETO and SETUO comparisons. Teach LegalizeDAG to expand SETUO expansion when UNE isn't legal.
If SETUNE isn't legal, UO can use the NOT of the SETO expansion.

Removes some complex isel patterns. Most of the test changes are
from using XORI instead of SEQZ.

Differential Revision: https://reviews.llvm.org/D92008
2020-12-10 09:15:52 -08:00
Sam Elliott a4a9a1f671 [RISCV] Add patterns for checking isnan
Summary:
This patch addresses some weird assembly sequences we were seeing during
comparing floats. In particular, comparing a float to itself tells you whether
it is NaN or not, which we were doing correctly, but with an extra unneeded
`and` instruction.

This patch specialises the existing patterns to remove the `and` instructions
when both their operands are the same.

Reviewed By: luismarques, asb

Differential Revision: https://reviews.llvm.org/D78908
2020-05-02 15:01:04 +01:00
Sam Elliott 910ca0e435 [RISCV][NFC] Add tests for checking isnan patterns
Summary:
I worked on adding some SelectionDag patterns to address code generated by these
examples, which came out of some differential testing against GCC. The pattern
additions will be in a follow-up patch.

Reviewers: luismarques, asb

Reviewed By: luismarques, asb

Differential Revision: https://reviews.llvm.org/D78907
2020-05-02 14:57:18 +01:00