[PATCH] D29841: [X86][SSE] Improve extraction of elements from v16i8 (pre-SSE41)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 11:46:58 PST 2017


RKSimon created this revision.
Herald added a subscriber: igorb.

Without SSE41 (pextrb) we currently extract byte elements from a vector by spilling to stack and reloading the byte.

This patch is an initial attempt at using MOVD/PEXTRW to extract the relevant DWORD/WORD from the vector and then shift+truncate to collect the correct byte.

Extraction of multiple bytes this way results in code bloat, but as explained in the patch we could probably afford to be more aggressive with the supported extractions before again falling back on spilling - possibly through counting the number of extracts and which DWORD/WORD they originate?


Repository:
  rL LLVM

https://reviews.llvm.org/D29841

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/extract-store.ll
  test/CodeGen/X86/extractelement-index.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29841.88028.patch
Type: text/x-patch
Size: 5006 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170210/5070eb7d/attachment.bin>


More information about the llvm-commits mailing list