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)
commitaf3e4a2f2f4cb233ed081bf0ab5baead0b042158
treed5cc6912239256dcaff756e42527827657845053
parentf8560e5a5bf4c06f3da6472162439bfed2a55fdf
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242037 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/cttz.ll [new file with mode: 0644]
test/CodeGen/ARM/cttz_vector.ll [new file with mode: 0644]
test/CodeGen/ARM/ctz.ll [deleted file]