[ARM,MVE] Add intrinsics to deal with predicates.
authorSimon Tatham <simon.tatham@arm.com>
Mon, 2 Dec 2019 16:17:59 +0000 (16:17 +0000)
committerSimon Tatham <simon.tatham@arm.com>
Mon, 2 Dec 2019 16:20:30 +0000 (16:20 +0000)
commitd173fb5d2854a1ce42bcc34832db5039b2c60e69
tree68655e854c5774fcad96180adac1007a95064f19
parent48cce077efcc3c3637aac0143b3c2c9d1cf7ab8b
[ARM,MVE] Add intrinsics to deal with predicates.

Summary:
This commit adds the `vpselq` intrinsics which take an MVE predicate
word and select lanes from two vectors; the `vctp` intrinsics which
create a tail predicate word suitable for processing the first m
elements of a vector (e.g. in the last iteration of a loop); and
`vpnot`, which simply complements a predicate word and is just
syntactic sugar for the `~` operator.

The `vctp` ACLE intrinsics are lowered to the IR intrinsics we've
already added (and which D70592 just reorganized). I've filled in the
missing isel rule for VCTP64, and added another set of rules to
generate the predicated forms.

I needed one small tweak in MveEmitter to allow the `unpromoted` type
modifier to apply to predicates as well as integers, so that `vpnot`
doesn't pointlessly convert its input integer to an `<n x i1>` before
complementing it.

Reviewers: ostannard, MarkMurrayARM, dmgreen

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D70485
clang/include/clang/Basic/arm_mve.td
clang/test/CodeGen/arm-mve-intrinsics/predicates.c [new file with mode: 0644]
clang/utils/TableGen/MveEmitter.cpp
llvm/lib/Target/ARM/ARMInstrMVE.td
llvm/test/CodeGen/Thumb2/mve-intrinsics/predicates.ll [new file with mode: 0644]