[PATCH] D20016: [X86][SSSE3] Lower vector CTLZ with PSHUFB lookups

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 05:35:48 PDT 2016


RKSimon created this revision.
RKSimon added reviewers: chandlerc, qcolombet, spatel, andreadb.
RKSimon added a subscriber: llvm-commits.
RKSimon set the repository for this revision to rL LLVM.

This patch uses PSHUFB to lower vector CTLZ and avoid (slower) scalarizations.

The leading zero count of each 4-bit nibble of the vector is determine by using a PSHUFB lookup. Pairs of results are then repeatedly combined up to the original element width.

Repository:
  rL LLVM

http://reviews.llvm.org/D20016

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/vector-lzcnt-128.ll
  test/CodeGen/X86/vector-lzcnt-256.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20016.56407.patch
Type: text/x-patch
Size: 112910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160506/21e1b4b4/attachment-0001.bin>


More information about the llvm-commits mailing list