OSDN Git Service

[ARM] MVE saturating truncates
authorDavid Green <david.green@arm.com>
Sat, 16 May 2020 13:54:33 +0000 (14:54 +0100)
committerDavid Green <david.green@arm.com>
Sat, 16 May 2020 14:10:20 +0000 (15:10 +0100)
commit2e1fbf85b65de7a45f71c9566136ce19428660ea
treeebddcdc125b6822699918abaf2c3bc50b7582544
parent228913780b61d7399de5150b1c5d85875d9198f0
[ARM] MVE saturating truncates

This adds some custom lowering for VQMOVN, 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 equal or a win most of the time, and allows
some extra follow-up folding to happen.

Differential Revision: https://reviews.llvm.org/D77590
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-combine.ll
llvm/test/CodeGen/Thumb2/mve-vqmovn.ll
llvm/test/CodeGen/Thumb2/mve-vqshrn.ll