[mips][msa] Combine binsri-like DAG of AND and OR into equivalent VSELECT
authorDaniel Sanders <daniel.sanders@imgtec.com>
Wed, 30 Oct 2013 13:51:01 +0000 (13:51 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Wed, 30 Oct 2013 13:51:01 +0000 (13:51 +0000)
commita7c3cac87118c3e409a7fc889090c5ffe242985e
tree0bf0d2fea2fa6acf79bcbf5e6c6d21a89400f2cd
parentaed9334acfdd8fa7548dc540fe865a5a641cb208
[mips][msa] Combine binsri-like DAG of AND and OR into equivalent VSELECT

(or (and $a, $mask), (and $b, $inverse_mask)) => (vselect $mask, $a, $b).
where $mask is a constant splat. This allows bitwise operations to make use
of bsel.

It's also a stepping stone towards matching bins[lr], and bins[lr]i from
normal IR.

Two sets of similar tests have been added in this commit. The bsel_* functions
test the case where binsri cannot be used. The binsr_*_i functions will
start to use the binsri instruction in the next commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193682 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsSEISelLowering.cpp
test/CodeGen/Mips/msa/bitwise.ll