X86: Turn fp selects into mask operations.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 4 Aug 2013 12:05:16 +0000 (12:05 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 4 Aug 2013 12:05:16 +0000 (12:05 +0000)
commit75311b7b4dbb284e7539c0c62331387f3c4cd1ec
treed44a1ce6a1fcb67f4cb4286ffd5e2ecbde8a2fa9
parentf3e3417e652420a2880fe1efa98ff11936f082e1
X86: Turn fp selects into mask operations.

double test(double a, double b, double c, double d) { return a<b ? c : d; }

before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0

after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0

Small speedup on Benchmarks/SmallPT

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187706 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/README-SSE.txt
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
lib/Target/X86/X86InstrFragmentsSIMD.td
lib/Target/X86/X86InstrSSE.td
test/CodeGen/X86/compare-inf.ll
test/CodeGen/X86/fp-select-cmp-and.ll [new file with mode: 0644]
test/CodeGen/X86/sse-minmax.ll