[ARM,MVE] Add intrinsics for abs, neg and not operations.
authorSimon Tatham <simon.tatham@arm.com>
Mon, 17 Feb 2020 17:03:52 +0000 (17:03 +0000)
committerSimon Tatham <simon.tatham@arm.com>
Tue, 18 Feb 2020 09:34:50 +0000 (09:34 +0000)
commit90dc78bc62784faaa55afb0320cf3c2187d80ac6
tree4339f1d4565d5020827bb6be5a5ef603d7a7d28b
parentf14680ce29663d098593e2f4e0eea96dbcaae0fb
[ARM,MVE] Add intrinsics for abs, neg and not operations.

Summary:
This commit adds the unpredicated intrinsics for the unary operations
vabsq (absolute value), vnegq (arithmetic negation), vmvnq (bitwise
complement), vqabsq and vqnegq (saturating versions of abs and neg for
signed integers, in the sense that they give INT_MAX if an input lane
is INT_MIN).

This is done entirely in clang: all of these operations have existing
isel patterns and existing tests for them on the LLVM side, so I've
just made clang emit the same IR that those patterns already match.

Reviewers: dmgreen, miyuki, MarkMurrayARM, ostannard

Reviewed By: MarkMurrayARM

Subscribers: kristof.beyls, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D74331
clang/include/clang/Basic/arm_mve.td
clang/include/clang/Basic/arm_mve_defs.td
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGen/arm-mve-intrinsics/absneg.c [new file with mode: 0644]