OSDN Git Service

[PowerPC] Implement the vpopcnt instructions for POWER8
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Tue, 3 Feb 2015 21:58:23 +0000 (21:58 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Tue, 3 Feb 2015 21:58:23 +0000 (21:58 +0000)
commit8c775a4e7b39674f0450b63d176fc090d4f8d379
tree0eba00422cc5565c5bf165a7eec006d3ff21ebf0
parent04e540582bed6352741d9a0d013a9888df5996a6
[PowerPC] Implement the vpopcnt instructions for POWER8

Patch by Kit Barton.

Add the vector population count instructions for byte, halfword, word,
and doubleword sizes.  There are two major changes here:

    PPCISelLowering.cpp: Make CTPOP legal for vector types.
    PPCRegisterInfo.td: Added v2i64 to the VRRC register
      definition. This is needed for the doubleword variations of the
      integer ops that were added in P8.

Test Plan

Test the instruction vpcnt* encoding/decoding in ppc64-encoding-vmx.s

Test the generation of the vpopcnt instructions for various vector
data types.  When adding the v2i64 type to the Vector Register set, I
also needed to add the appropriate bit conversion patterns between
v2i64 and the existing vector types.  Testing for these conversions
were also added in the test case by passing a different vector type as
a parameter into the test functions.  There is also a run step that
will ensure the vpopcnt instructions are generated when the vsx
feature is disabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228046 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPC.td
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCInstrAltivec.td
lib/Target/PowerPC/PPCRegisterInfo.td
lib/Target/PowerPC/PPCSubtarget.cpp
lib/Target/PowerPC/PPCSubtarget.h
test/MC/Disassembler/PowerPC/ppc64-encoding-vmx.txt
test/MC/PowerPC/ppc64-encoding-vmx.s