[mips][msa] Fix vector insertions where the index is variable
authorDaniel Sanders <daniel.sanders@imgtec.com>
Wed, 30 Apr 2014 12:09:32 +0000 (12:09 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Wed, 30 Apr 2014 12:09:32 +0000 (12:09 +0000)
commit1c8add99789a3066e94e97c56a6ce11a5c8e8740
tree501cfd87ae4e95427c1482e0108e5d5ff1d1aeb6
parent4e29e3a10ad3ef6ad9e14295eb24c3444aa107cb
[mips][msa] Fix vector insertions where the index is variable

Summary:
This isn't supported directly so we rotate the vector by the desired number of
elements, insert to element zero, then rotate back.

The i64 case generates rather poor code on MIPS32. There is an obvious
optimisation to be made in future (do both insert.w's inside a shared
rotate/unrotate sequence) but for now it's sufficient to select valid code
instead of aborting.

Depends on D3536

Reviewers: matheusalmeida

Reviewed By: matheusalmeida

Differential Revision: http://reviews.llvm.org/D3537

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207640 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsMSAInstrInfo.td
lib/Target/Mips/MipsSEISelLowering.cpp
lib/Target/Mips/MipsSEISelLowering.h
test/CodeGen/Mips/msa/basic_operations.ll
test/CodeGen/Mips/msa/basic_operations_float.ll