[x86] Add support for bit-wise blending and use it in the v8 and v16
authorChandler Carruth <chandlerc@gmail.com>
Thu, 19 Feb 2015 10:46:52 +0000 (10:46 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 19 Feb 2015 10:46:52 +0000 (10:46 +0000)
commitbcb6c5f62d375e45927a0b6e1177f45286dbcfab
tree9fde5c65d8bfeaba8198dd9780f02bb74903c697
parentb89464a9b637bd57daa03507d14a7824ecc63e8e
[x86] Add support for bit-wise blending and use it in the v8 and v16
lowering paths. I'm going to be leveraging this to simplify a lot of the
overly complex lowering of v8 and v16 shuffles in pre-SSSE3 modes.

Sadly, this isn't profitable on v4i32 and v2i64. There, the float and
double blending instructions for pre-SSE4.1 are actually pretty good,
and we can't beat them with bit math. And once SSE4.1 comes around we
have direct blending support and this ceases to be relevant.

Also, some of the test cases look odd because the domain fixer
canonicalizes these to floating point domain. That's OK, it'll use the
integer domain when it matters and some day I may be able to update
enough of LLVM to canonicalize the other way.

This restores almost all of the regressions from teaching x86's vselect
lowering to always use vector shuffle lowering for blends. The remaining
problems are because the v16 lowering path is still doing crazy things.
I'll be re-arranging that strategy in more detail in subsequent commits
to finish recovering the performance here.

llvm-svn: 229836
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/sse3.ll
llvm/test/CodeGen/X86/vector-blend.ll
llvm/test/CodeGen/X86/vector-shuffle-128-v16.ll
llvm/test/CodeGen/X86/vector-shuffle-128-v8.ll
llvm/test/CodeGen/X86/vselect.ll