ARM: Fix incorrect pack pattern
authorArnold Schwaighofer <aschwaighofer@apple.com>
Fri, 5 Jul 2013 18:28:39 +0000 (18:28 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Fri, 5 Jul 2013 18:28:39 +0000 (18:28 +0000)
commitffd3bb8f0d875f4aae3097660f973b1e7512ee05
treefc5b421808be0bd3f62e06f3ffb2e192687a1e80
parent23191804e8cab4e60c82cd39f3a7d2ea152489a5
ARM: Fix incorrect pack pattern

A "pkhtb x, x, y asr #num" uses the lower 16 bits of "y asr #num" and packs them
in the bottom half of "x". An arithmetic and logic shift are only equivalent in
this context if the shift amount is 16. We would be shifting in ones into the
bottom 16bits instead of zeros if "y" is negative.

radar://14338767

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185712 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMInstrInfo.td
test/CodeGen/ARM/pack.ll