[llvm] [cmake] Add possibility to use ChooseMSVCCRT.cmake when include LLVM library
[llvm-core.git] / test / CodeGen / AArch64 / sve-intrinsics-int-arith.ll
blob08e475b227990afaadbdee00a29a04eba1c9f8fa
1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
4 ; ABS
7 define <vscale x 16 x i8> @abs_i8(<vscale x 16 x i8> %a, <vscale x 16 x i1> %pg, <vscale x 16 x i8> %b) {
8 ; CHECK-LABEL: abs_i8:
9 ; CHECK: abs z0.b, p0/m, z1.b
10 ; CHECK-NEXT: ret
11   %out = call <vscale x 16 x i8> @llvm.aarch64.sve.abs.nxv16i8(<vscale x 16 x i8> %a,
12                                                                <vscale x 16 x i1> %pg,
13                                                                <vscale x 16 x i8> %b)
14   ret <vscale x 16 x i8> %out
17 define <vscale x 8 x i16> @abs_i16(<vscale x 8 x i16> %a, <vscale x 8 x i1> %pg, <vscale x 8 x i16> %b) {
18 ; CHECK-LABEL: abs_i16:
19 ; CHECK: abs z0.h, p0/m, z1.h
20 ; CHECK-NEXT: ret
21   %out = call <vscale x 8 x i16> @llvm.aarch64.sve.abs.nxv8i16(<vscale x 8 x i16> %a,
22                                                                <vscale x 8 x i1> %pg,
23                                                                <vscale x 8 x i16> %b)
24   ret <vscale x 8 x i16> %out
27 define <vscale x 4 x i32> @abs_i32(<vscale x 4 x i32> %a, <vscale x 4 x i1> %pg, <vscale x 4 x i32> %b) {
28 ; CHECK-LABEL: abs_i32:
29 ; CHECK: abs z0.s, p0/m, z1.s
30 ; CHECK-NEXT: ret
31   %out = call <vscale x 4 x i32> @llvm.aarch64.sve.abs.nxv4i32(<vscale x 4 x i32> %a,
32                                                                <vscale x 4 x i1> %pg,
33                                                                <vscale x 4 x i32> %b)
34   ret <vscale x 4 x i32> %out
37 define <vscale x 2 x i64> @abs_i64(<vscale x 2 x i64> %a, <vscale x 2 x i1> %pg, <vscale x 2 x i64> %b) {
38 ; CHECK-LABEL: abs_i64:
39 ; CHECK: abs z0.d, p0/m, z1.d
40 ; CHECK-NEXT: ret
41   %out = call <vscale x 2 x i64> @llvm.aarch64.sve.abs.nxv2i64(<vscale x 2 x i64> %a,
42                                                                <vscale x 2 x i1> %pg,
43                                                                <vscale x 2 x i64> %b)
44   ret <vscale x 2 x i64> %out
48 ; NEG
51 define <vscale x 16 x i8> @neg_i8(<vscale x 16 x i8> %a, <vscale x 16 x i1> %pg, <vscale x 16 x i8> %b) {
52 ; CHECK-LABEL: neg_i8:
53 ; CHECK: neg z0.b, p0/m, z1.b
54 ; CHECK-NEXT: ret
55   %out = call <vscale x 16 x i8> @llvm.aarch64.sve.neg.nxv16i8(<vscale x 16 x i8> %a,
56                                                                <vscale x 16 x i1> %pg,
57                                                                <vscale x 16 x i8> %b)
58   ret <vscale x 16 x i8> %out
61 define <vscale x 8 x i16> @neg_i16(<vscale x 8 x i16> %a, <vscale x 8 x i1> %pg, <vscale x 8 x i16> %b) {
62 ; CHECK-LABEL: neg_i16:
63 ; CHECK: neg z0.h, p0/m, z1.h
64 ; CHECK-NEXT: ret
65   %out = call <vscale x 8 x i16> @llvm.aarch64.sve.neg.nxv8i16(<vscale x 8 x i16> %a,
66                                                                <vscale x 8 x i1> %pg,
67                                                                <vscale x 8 x i16> %b)
68   ret <vscale x 8 x i16> %out
71 define <vscale x 4 x i32> @neg_i32(<vscale x 4 x i32> %a, <vscale x 4 x i1> %pg, <vscale x 4 x i32> %b) {
72 ; CHECK-LABEL: neg_i32:
73 ; CHECK: neg z0.s, p0/m, z1.s
74 ; CHECK-NEXT: ret
75   %out = call <vscale x 4 x i32> @llvm.aarch64.sve.neg.nxv4i32(<vscale x 4 x i32> %a,
76                                                                <vscale x 4 x i1> %pg,
77                                                                <vscale x 4 x i32> %b)
78   ret <vscale x 4 x i32> %out
81 define <vscale x 2 x i64> @neg_i64(<vscale x 2 x i64> %a, <vscale x 2 x i1> %pg, <vscale x 2 x i64> %b) {
82 ; CHECK-LABEL: neg_i64:
83 ; CHECK: neg z0.d, p0/m, z1.d
84 ; CHECK-NEXT: ret
85   %out = call <vscale x 2 x i64> @llvm.aarch64.sve.neg.nxv2i64(<vscale x 2 x i64> %a,
86                                                                <vscale x 2 x i1> %pg,
87                                                                <vscale x 2 x i64> %b)
88   ret <vscale x 2 x i64> %out
91 declare <vscale x 16 x i8> @llvm.aarch64.sve.abs.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i1>, <vscale x 16 x i8>)
92 declare <vscale x 8 x i16> @llvm.aarch64.sve.abs.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>, <vscale x 8 x i16>)
93 declare <vscale x 4 x i32> @llvm.aarch64.sve.abs.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>, <vscale x 4 x i32>)
94 declare <vscale x 2 x i64> @llvm.aarch64.sve.abs.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i1>, <vscale x 2 x i64>)
96 declare <vscale x 16 x i8> @llvm.aarch64.sve.neg.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i1>, <vscale x 16 x i8>)
97 declare <vscale x 8 x i16> @llvm.aarch64.sve.neg.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>, <vscale x 8 x i16>)
98 declare <vscale x 4 x i32> @llvm.aarch64.sve.neg.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>, <vscale x 4 x i32>)
99 declare <vscale x 2 x i64> @llvm.aarch64.sve.neg.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i1>, <vscale x 2 x i64>)