ARM: Fix cttz expansion on vector types.
authorLogan Chien <tzuhsiang.chien@gmail.com>
Mon, 13 Jul 2015 15:37:30 +0000 (15:37 +0000)
committerLogan Chien <tzuhsiang.chien@gmail.com>
Mon, 13 Jul 2015 15:37:30 +0000 (15:37 +0000)
commit0a43abc9f841246ba2974fe189628d7c45484cb6
tree9e64cc838db184a3b43bc4c81dcac37fa15a14d8
parent69bf1ce03a52bac5050ffaae5f311541d573bb99
ARM: Fix cttz expansion on vector types.

The 64/128-bit vector types are legal if NEON instructions are
available.  However, there was no matching patterns for @llvm.cttz.*()
intrinsics and result in fatal error.

This commit fixes the problem by lowering cttz to:
a. ctpop((x & -x) - 1)
b. width - ctlz(x & -x) - 1

llvm-svn: 242037
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/cttz.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/cttz_vector.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/ctz.ll [deleted file]