[PATCH] D77590: [ARM] MVE saturating truncates

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 15:16:40 PDT 2020


dmgreen created this revision.
dmgreen added reviewers: SjoerdMeijer, samparker, simon_tatham, ostannard.
Herald added subscribers: hiraditya, kristof.beyls.

This adds some custom lowering for VQMOV, an instruction that can be used to perform saturating truncates from a pair of min(max(X, -0x8000), 0x7fff), providing those constants are correct. This leaves a VQMOVNBs which saturates the value and inserts that into the bottom lanes of an existing vector. We then need to do something with the other lanes, extending the value using a vmovlb.

Ideally, as will often be the case, only the bottom lane of what remains will be demanded, allowing the vmovlb to be removed. Which should mean the instruction is either a equal or a win most of the time, and allows some extra follow-up folding to happen.


https://reviews.llvm.org/D77590

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMISelLowering.h
  llvm/lib/Target/ARM/ARMInstrMVE.td
  llvm/test/CodeGen/Thumb2/mve-satmul-loops.ll
  llvm/test/CodeGen/Thumb2/mve-vqmovn.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77590.255495.patch
Type: text/x-patch
Size: 67218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200406/272d7832/attachment.bin>


More information about the llvm-commits mailing list