[mips][msa] Added support for matching bmnz, bmnzi, bmz, and bmzi from normal IR...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Wed, 30 Oct 2013 15:20:38 +0000 (15:20 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Wed, 30 Oct 2013 15:20:38 +0000 (15:20 +0000)
commitab94b537d75278f93918b202417c23ad561a101b
tree3738550589671b729b1325fdf7de6c7adb7354e4
parent4d55e6e0a4f406f563ddaaca81b20b9b86bc5916
[mips][msa] Added support for matching bmnz, bmnzi, bmz, and bmzi from normal IR (i.e. not intrinsics)

Also corrected the definition of the intrinsics for these instructions (the
result register is also the first operand), and added intrinsics for bsel and
bseli to clang (they already existed in the backend).

These four operations are mostly equivalent to bsel, and bseli (the difference
is which operand is tied to the result). As a result some of the tests changed
as described below.

bitwise.ll:
- bsel.v test adapted so that the mask is unknown at compile-time. This stops
  it emitting bmnzi.b instead of the intended bsel.v.
- The bseli.b test now tests the right thing. Namely the case when one of the
  values is an uimm8, rather than when the condition is a uimm8 (which is
  covered by bmnzi.b)

compare.ll:
- bsel.v tests now (correctly) emits bmnz.v instead of bsel.v because this
  is the same operation (see MSA.txt).

i8.ll
- CHECK-DAG-ized test.
- bmzi.b test now (correctly) emits equivalent bmnzi.b with swapped operands
  because this is the same operation (see MSA.txt).
- bseli.b still emits bseli.b though because the immediate makes it
  distinguishable from bmnzi.b.

vec.ll:
- CHECK-DAG-ized test.
- bmz.v tests now (correctly) emits bmnz.v with swapped operands (see
  MSA.txt).
- bsel.v tests now (correctly) emits bmnz.v with swapped operands (see
  MSA.txt).

llvm-svn: 193693
clang/include/clang/Basic/BuiltinsMips.def
clang/test/CodeGen/builtins-mips-msa.c
llvm/include/llvm/IR/IntrinsicsMips.td
llvm/lib/Target/Mips/MSA.txt
llvm/lib/Target/Mips/MipsMSAInstrInfo.td
llvm/lib/Target/Mips/MipsSEISelLowering.cpp
llvm/test/CodeGen/Mips/msa/bitwise.ll
llvm/test/CodeGen/Mips/msa/compare.ll
llvm/test/CodeGen/Mips/msa/i8.ll
llvm/test/CodeGen/Mips/msa/vec.ll