[PowerPC] Implement the vclz instructions for PWR8
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Thu, 5 Feb 2015 15:24:47 +0000 (15:24 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Thu, 5 Feb 2015 15:24:47 +0000 (15:24 +0000)
commit202b6045bfb22b478a62e37ab0e62f67cd7b16b6
tree17b559dc97d37621ce9a82bf7bd16dcb0a6be0bd
parent29b65fa1dffaf01292672588cf50c36485d993dc
[PowerPC] Implement the vclz instructions for PWR8

Patch by Kit Barton.

Add the vector count leading zeros instruction for byte, halfword,
word, and doubleword sizes.  This is a fairly straightforward addition
after the changes made for vpopcnt:

 1. Add the correct definitions for the various instructions in
    PPCInstrAltivec.td
 2. Make the CTLZ operation legal on vector types when using P8Altivec
    in PPCISelLowering.cpp

Test Plan

Created new test case in test/CodeGen/PowerPC/vec_clz.ll to check the
instructions are being generated when the CTLZ operation is used in
LLVM.

Check the encoding and decoding in test/MC/PowerPC/ppc_encoding_vmx.s
and test/Disassembler/PowerPC/ppc_encoding_vmx.txt respectively.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228301 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCInstrAltivec.td
test/CodeGen/PowerPC/vec_clz.ll [new file with mode: 0644]
test/MC/Disassembler/PowerPC/ppc64-encoding-vmx.txt
test/MC/PowerPC/ppc64-encoding-vmx.s