diff options
| author | Kerry McLaughlin <kerry.mclaughlin@arm.com> | 2019-10-30 11:13:49 +0000 |
|---|---|---|
| committer | Kerry McLaughlin <kerry.mclaughlin@arm.com> | 2019-10-30 11:31:54 +0000 |
| commit | e128c208648998e11a4f44edf7ef3bff9a604807 (patch) | |
| tree | fa7a0669991af65945714ddedbea2cb8ada01c0e /llvm/test/CodeGen/AArch64/sve-intrinsics-counting-bits.ll | |
| parent | b592253ec680e82d0d4a6c51429ca6166a3aaf99 (diff) | |
| download | bcm5719-llvm-e128c208648998e11a4f44edf7ef3bff9a604807.tar.gz bcm5719-llvm-e128c208648998e11a4f44edf7ef3bff9a604807.zip | |
[AArch64][SVE] Implement additional integer arithmetic intrinsics
Summary:
Add intrinsics for the following:
- sxt[b|h|w] & uxt[b|h|w]
- cls & clz
- not & cnot
Reviewers: huntergr, sdesmalen, dancgr
Reviewed By: sdesmalen
Subscribers: cameron.mcinally, tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69567
Diffstat (limited to 'llvm/test/CodeGen/AArch64/sve-intrinsics-counting-bits.ll')
| -rw-r--r-- | llvm/test/CodeGen/AArch64/sve-intrinsics-counting-bits.ll | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/sve-intrinsics-counting-bits.ll b/llvm/test/CodeGen/AArch64/sve-intrinsics-counting-bits.ll index 2350353a274..197e723e1d6 100644 --- a/llvm/test/CodeGen/AArch64/sve-intrinsics-counting-bits.ll +++ b/llvm/test/CodeGen/AArch64/sve-intrinsics-counting-bits.ll @@ -1,6 +1,94 @@ ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s ; +; CLS +; + +define <vscale x 16 x i8> @cls_i8(<vscale x 16 x i8> %a, <vscale x 16 x i1> %pg, <vscale x 16 x i8> %b) { +; CHECK-LABEL: cls_i8: +; CHECK: cls z0.b, p0/m, z1.b +; CHECK-NEXT: ret + %out = call <vscale x 16 x i8> @llvm.aarch64.sve.cls.nxv16i8(<vscale x 16 x i8> %a, + <vscale x 16 x i1> %pg, + <vscale x 16 x i8> %b) + ret <vscale x 16 x i8> %out +} + +define <vscale x 8 x i16> @cls_i16(<vscale x 8 x i16> %a, <vscale x 8 x i1> %pg, <vscale x 8 x i16> %b) { +; CHECK-LABEL: cls_i16: +; CHECK: cls z0.h, p0/m, z1.h +; CHECK-NEXT: ret + %out = call <vscale x 8 x i16> @llvm.aarch64.sve.cls.nxv8i16(<vscale x 8 x i16> %a, + <vscale x 8 x i1> %pg, + <vscale x 8 x i16> %b) + ret <vscale x 8 x i16> %out +} + +define <vscale x 4 x i32> @cls_i32(<vscale x 4 x i32> %a, <vscale x 4 x i1> %pg, <vscale x 4 x i32> %b) { +; CHECK-LABEL: cls_i32: +; CHECK: cls z0.s, p0/m, z1.s +; CHECK-NEXT: ret + %out = call <vscale x 4 x i32> @llvm.aarch64.sve.cls.nxv4i32(<vscale x 4 x i32> %a, + <vscale x 4 x i1> %pg, + <vscale x 4 x i32> %b) + ret <vscale x 4 x i32> %out +} + +define <vscale x 2 x i64> @cls_i64(<vscale x 2 x i64> %a, <vscale x 2 x i1> %pg, <vscale x 2 x i64> %b) { +; CHECK-LABEL: cls_i64: +; CHECK: cls z0.d, p0/m, z1.d +; CHECK-NEXT: ret + %out = call <vscale x 2 x i64> @llvm.aarch64.sve.cls.nxv2i64(<vscale x 2 x i64> %a, + <vscale x 2 x i1> %pg, + <vscale x 2 x i64> %b) + ret <vscale x 2 x i64> %out +} + +; +; CLZ +; + +define <vscale x 16 x i8> @clz_i8(<vscale x 16 x i8> %a, <vscale x 16 x i1> %pg, <vscale x 16 x i8> %b) { +; CHECK-LABEL: clz_i8: +; CHECK: clz z0.b, p0/m, z1.b +; CHECK-NEXT: ret + %out = call <vscale x 16 x i8> @llvm.aarch64.sve.clz.nxv16i8(<vscale x 16 x i8> %a, + <vscale x 16 x i1> %pg, + <vscale x 16 x i8> %b) + ret <vscale x 16 x i8> %out +} + +define <vscale x 8 x i16> @clz_i16(<vscale x 8 x i16> %a, <vscale x 8 x i1> %pg, <vscale x 8 x i16> %b) { +; CHECK-LABEL: clz_i16: +; CHECK: clz z0.h, p0/m, z1.h +; CHECK-NEXT: ret + %out = call <vscale x 8 x i16> @llvm.aarch64.sve.clz.nxv8i16(<vscale x 8 x i16> %a, + <vscale x 8 x i1> %pg, + <vscale x 8 x i16> %b) + ret <vscale x 8 x i16> %out +} + +define <vscale x 4 x i32> @clz_i32(<vscale x 4 x i32> %a, <vscale x 4 x i1> %pg, <vscale x 4 x i32> %b) { +; CHECK-LABEL: clz_i32: +; CHECK: clz z0.s, p0/m, z1.s +; CHECK-NEXT: ret + %out = call <vscale x 4 x i32> @llvm.aarch64.sve.clz.nxv4i32(<vscale x 4 x i32> %a, + <vscale x 4 x i1> %pg, + <vscale x 4 x i32> %b) + ret <vscale x 4 x i32> %out +} + +define <vscale x 2 x i64> @clz_i64(<vscale x 2 x i64> %a, <vscale x 2 x i1> %pg, <vscale x 2 x i64> %b) { +; CHECK-LABEL: clz_i64: +; CHECK: clz z0.d, p0/m, z1.d +; CHECK-NEXT: ret + %out = call <vscale x 2 x i64> @llvm.aarch64.sve.clz.nxv2i64(<vscale x 2 x i64> %a, + <vscale x 2 x i1> %pg, + <vscale x 2 x i64> %b) + ret <vscale x 2 x i64> %out +} + +; ; CNT ; @@ -74,6 +162,16 @@ define <vscale x 2 x i64> @cnt_f64(<vscale x 2 x i64> %a, <vscale x 2 x i1> %pg, ret <vscale x 2 x i64> %out } +declare <vscale x 16 x i8> @llvm.aarch64.sve.cls.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i1>, <vscale x 16 x i8>) +declare <vscale x 8 x i16> @llvm.aarch64.sve.cls.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>, <vscale x 8 x i16>) +declare <vscale x 4 x i32> @llvm.aarch64.sve.cls.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>, <vscale x 4 x i32>) +declare <vscale x 2 x i64> @llvm.aarch64.sve.cls.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i1>, <vscale x 2 x i64>) + +declare <vscale x 16 x i8> @llvm.aarch64.sve.clz.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i1>, <vscale x 16 x i8>) +declare <vscale x 8 x i16> @llvm.aarch64.sve.clz.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>, <vscale x 8 x i16>) +declare <vscale x 4 x i32> @llvm.aarch64.sve.clz.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>, <vscale x 4 x i32>) +declare <vscale x 2 x i64> @llvm.aarch64.sve.clz.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i1>, <vscale x 2 x i64>) + declare <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i1>, <vscale x 16 x i8>) declare <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>, <vscale x 8 x i16>) declare <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>, <vscale x 4 x i32>) |

