[PATCH] D20598: [X86] Detect SAD patterns and emit psadbw instructions on X86 redux

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Tue May 24 13:52:02 PDT 2016


mkuper created this revision.
mkuper added reviewers: congh, RKSimon, hfinkel.
mkuper added subscribers: llvm-commits, davidxl, wmi.

This fixes PR27539 in the SAD detection code originally commited in http://reviews.llvm.org/rL267649 
The patch is intentionally against r267722 and not against trunk (in which r267649 has been reverted), to highlight the diff vs. the original patch.

The original patch wasn't happy with reductions where the reduction vector was smaller than the result of the psadbw.
This can be handled by taking the low part of the result of the psadbw - this should be safe, since when the the reduction type is narrower than the psadbw result, the input vectors are also narrow, so the non-zero part of the psadbw result is even narrower.

http://reviews.llvm.org/D20598

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20598.58307.patch
Type: text/x-patch
Size: 6500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160524/c5808ef1/attachment.bin>


More information about the llvm-commits mailing list