[SDAG] Optimize unordered comparison in soft-float mode (patch by Anton Nadolskiy)
authorAlexey Bataev <a.bataev@hotmail.com>
Wed, 15 Jul 2015 08:39:35 +0000 (08:39 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Wed, 15 Jul 2015 08:39:35 +0000 (08:39 +0000)
commita01809966911a7614e877c0a7e08a5ab507e2f60
treee38abbe20c443cfcb4240d478584b35b87713ba3
parent8913d18fb1f694c7ea363a8f2ea002673d025202
[SDAG] Optimize unordered comparison in soft-float mode (patch by Anton Nadolskiy)

Current implementation handles unordered comparison poorly in soft-float mode.
Consider (a ULE b) which is a <= b. It is lowered to (ledf2(a, b) <= 0 || unorddf2(a, b) != 0) (in general). We can do better job by lowering it to (__gtdf2(a, b) <= 0).
Such replacement is true for other CMP's (ult, ugt, uge). In general, we just call same function as for ordered case but negate comparison against zero.
Differential Revision: http://reviews.llvm.org/D10804

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242280 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/AArch64/arm64-fp128.ll
test/CodeGen/Mips/mips16fpe.ll
test/CodeGen/Thumb2/float-cmp.ll
test/CodeGen/Thumb2/float-intrinsics-double.ll
test/CodeGen/X86/fpcmp-soft-fp.ll [new file with mode: 0644]