OSDN Git Service

[ARM] MVE VCVT lowering for f32->f16 truncs
authorDavid Green <david.green@arm.com>
Thu, 25 Jun 2020 12:25:38 +0000 (13:25 +0100)
committerDavid Green <david.green@arm.com>
Thu, 25 Jun 2020 14:59:36 +0000 (15:59 +0100)
commit3cb2190b0ba3f54d6b540ba8ba44f5c26c6e898f
treea530b5d35d3b794ec0ec373bac315d09cf77ba4c
parentda852b03b009141b1deda8c4bda83149d64e7666
[ARM] MVE VCVT lowering for f32->f16 truncs

This adds code to lower f32 to f16 fp_trunc's using a pair of MVE VCVT
instructions. Due to v4f16 not being legal, fp_round are often split up
fairly early. So this reconstructs the vcvt's from a buildvector of
fp_rounds from two vector inputs. Something like:

BUILDVECTOR(FP_ROUND(EXTRACT_ELT(X, 0),
            FP_ROUND(EXTRACT_ELT(Y, 0),
            FP_ROUND(EXTRACT_ELT(X, 1),
            FP_ROUND(EXTRACT_ELT(Y, 1), ...)

It adds a VCVTN node to handle this, which like VMOVN or VQMOVN lowers
into the top/bottom lanes of an MVE instruction.

Differential Revision: https://reviews.llvm.org/D81139
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/lib/Target/ARM/ARMISelLowering.h
llvm/lib/Target/ARM/ARMInstrMVE.td
llvm/test/CodeGen/Thumb2/mve-fp16convertloops.ll
llvm/test/CodeGen/Thumb2/mve-vcvt16.ll