[FastISel][AArch64] Fix shift lowering for i8 and i16 value types.
authorJuergen Ributzka <juergen@apple.com>
Mon, 4 Aug 2014 21:49:51 +0000 (21:49 +0000)
committerJuergen Ributzka <juergen@apple.com>
Mon, 4 Aug 2014 21:49:51 +0000 (21:49 +0000)
commit2c68cde70178838e0603e12978d64c57b9bfa1ab
tree88e534e4e2cc24b5569d1bd14a528c6cc7ce9378
parent3bc3e03f74f41a0b1a2590dad366013a9f890b84
[FastISel][AArch64] Fix shift lowering for i8 and i16 value types.

This fix changes the parameters #r and #s that are passed to the UBFM/SBFM
instruction to get the zero/sign-extension for free.

The original problem was that the shift left would use the 32-bit shift even for
i8/i16 value types, which could leave the upper bits set with "garbage" values.

The arithmetic shift right on the other side would use the wrong MSB as sign-bit
to determine what bits to shift into the value.

This fixes <rdar://problem/17907720>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214788 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64FastISel.cpp
test/CodeGen/AArch64/fast-isel-shift.ll