For Mips 16, add the optimization where the 16 bit form of addiu sp can be used
authorReed Kotler <rkotler@mips.com>
Wed, 13 Feb 2013 20:28:27 +0000 (20:28 +0000)
committerReed Kotler <rkotler@mips.com>
Wed, 13 Feb 2013 20:28:27 +0000 (20:28 +0000)
commit6b9d4617800d9450825f8a4b122a9aeb76f2795f
treec93e5dc6df7bc40175ee7348f5c282e659c0c8b6
parentf098620095727dd2a823a94a3a8d47108361ad83
For Mips 16, add the optimization where the 16 bit form of addiu sp can be used
if the offset fits in 11 bits. This makes use of the fact that the abi
requires sp to be 8 byte aligned so the actual offset can fit in 8
bits. It will be shifted left and sign extended before being actually used.
The assembler or direct object emitter will shift right the 11 bit
signed field by 3 bits. We don't need to deal with that here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175073 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/Mips16InstrInfo.cpp
lib/Target/Mips/Mips16InstrInfo.h
lib/Target/Mips/Mips16InstrInfo.td
test/CodeGen/Mips/align16.ll [new file with mode: 0644]