[mips][msa] Fix invalid generated code when lowering FrameIndex involving unaligned...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Mon, 9 Dec 2013 12:47:12 +0000 (12:47 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Mon, 9 Dec 2013 12:47:12 +0000 (12:47 +0000)
commit68138dc9a89cda52bdc7d27bbebec194809e93cf
tree6bc7e74e05815966ac88f6a1cf655389d03c3280
parent897268d931a84872d88ad05b18027b6b9723e03e
[mips][msa] Fix invalid generated code when lowering FrameIndex involving unaligned offsets.

Summary:
The MSA ld.[bhwd] and st.[bhwd] instructions scale the immediate by the
element size before use as an offset. The offset must therefore be a
multiple of the element size to be valid in these instructions. However,
an unaligned base address is valid in MSA.

This commit causes the compiler to emit valid code when the calculated
offset is not a multiple of the element size by accounting for the offset
using addiu and using a zero offset in the load/store.

Depends on D2338

Reviewers: matheusalmeida

Reviewed By: matheusalmeida

Differential Revision: http://llvm-reviews.chandlerc.com/D2339

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