Add support bswap16 to/from memory compiling to rev16 on ARM/Thumb
authorLouis Gerbarg <lgg@apple.com>
Mon, 12 May 2014 19:53:52 +0000 (19:53 +0000)
committerLouis Gerbarg <lgg@apple.com>
Mon, 12 May 2014 19:53:52 +0000 (19:53 +0000)
commit9cec62a27fe56f1775e23fdae57300edfdfe2699
tree96197c21a13935093389b8b2678ec1cc80e27302
parentb36e348af3d593eebc07dc9b6be8ecc57ae88a09
Add support bswap16 to/from memory compiling to rev16 on ARM/Thumb

The current patterns for REV16 misses mostn __builtin_bswap16() due to
legalization promoting the operands to from load/stores toi32s and then
truncing/extending them. This patch adds new patterns that catch the resultant
DAGs and codegens them to rev16 instructions. Tests included.

rdar://15353652

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208620 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMInstrThumb.td
test/CodeGen/ARM/bswap16.ll [new file with mode: 0644]