[PATCH] D59662: [X86] Use xmm registers to implement 64-bit popcnt on 32-bit targets if possible if popcnt instruction is not available

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 12:13:07 PDT 2019


craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

On 32-bit targets without popcnt, we currently expand 64-bit popcnt to sequences of arithmetic and logic ops for each 32-bit half and then add the 32 bit halves together. If we have xmm registers we can use use those to implement the operation instead. This results in less instructions then doing two separate 32-bit popcnt sequences.


https://reviews.llvm.org/D59662

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/popcnt.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59662.191759.patch
Type: text/x-patch
Size: 7573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190321/d8aa40fa/attachment.bin>


More information about the llvm-commits mailing list