X86: Enable ISel of 16-bit MOVBE instructions.
authorJim Grosbach <grosbach@apple.com>
Tue, 11 Mar 2014 00:44:14 +0000 (00:44 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 11 Mar 2014 00:44:14 +0000 (00:44 +0000)
commit7a37166a7a2c0c5dd8f8c5d8320f8f7505437f53
tree05ce2bedef081448307e29fe2e0ba63988e5620f
parent2ab1641041a6a96af5578d89e4d7f8c932cad381
X86: Enable ISel of 16-bit MOVBE instructions.

When the MOVBE instructions are available, use them for 16-bit endian
swapping as well as for 32 and 64 bit.

The patterns were already present on the instructions, but weren't being
matched because the operation was unconditionally marked to 'Expand.'
Change that to be conditional on whether the MOVBE instructions are
available. Use 'rolw' to implement the in-register version (32 and 64
bit have the dedicated 'bswap' instruction for that).

Patch by Louis Gerbarg <lgg@apple.com>.

rdar://15479984

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203524 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrCompiler.td
test/CodeGen/X86/movbe.ll