1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
3 define <vscale x 16 x i8> @mad_i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> %b, <vscale x 16 x i8> %c) {
5 ; CHECK: mad z0.b, p0/m, z1.b, z2.b
7 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.mad.nxv16i8(<vscale x 16 x i1> %pg,
10 <vscale x 16 x i8> %c)
11 ret <vscale x 16 x i8> %out
14 define <vscale x 8 x i16> @mad_i16(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b, <vscale x 8 x i16> %c) {
15 ; CHECK-LABEL: mad_i16:
16 ; CHECK: mad z0.h, p0/m, z1.h, z2.h
18 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.mad.nxv8i16(<vscale x 8 x i1> %pg,
19 <vscale x 8 x i16> %a,
20 <vscale x 8 x i16> %b,
21 <vscale x 8 x i16> %c)
22 ret <vscale x 8 x i16> %out
25 define <vscale x 4 x i32> @mad_i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, <vscale x 4 x i32> %c) {
26 ; CHECK-LABEL: mad_i32:
27 ; CHECK: mad z0.s, p0/m, z1.s, z2.s
29 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.mad.nxv4i32(<vscale x 4 x i1> %pg,
30 <vscale x 4 x i32> %a,
31 <vscale x 4 x i32> %b,
32 <vscale x 4 x i32> %c)
33 ret <vscale x 4 x i32> %out
36 define <vscale x 2 x i64> @mad_i64(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %a, <vscale x 2 x i64> %b, <vscale x 2 x i64> %c) {
37 ; CHECK-LABEL: mad_i64:
38 ; CHECK: mad z0.d, p0/m, z1.d, z2.d
40 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.mad.nxv2i64(<vscale x 2 x i1> %pg,
41 <vscale x 2 x i64> %a,
42 <vscale x 2 x i64> %b,
43 <vscale x 2 x i64> %c)
44 ret <vscale x 2 x i64> %out
47 define <vscale x 16 x i8> @msb_i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> %b, <vscale x 16 x i8> %c) {
48 ; CHECK-LABEL: msb_i8:
49 ; CHECK: msb z0.b, p0/m, z1.b, z2.b
51 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.msb.nxv16i8(<vscale x 16 x i1> %pg,
52 <vscale x 16 x i8> %a,
53 <vscale x 16 x i8> %b,
54 <vscale x 16 x i8> %c)
55 ret <vscale x 16 x i8> %out
58 define <vscale x 8 x i16> @msb_i16(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b, <vscale x 8 x i16> %c) {
59 ; CHECK-LABEL: msb_i16:
60 ; CHECK: msb z0.h, p0/m, z1.h, z2.h
62 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.msb.nxv8i16(<vscale x 8 x i1> %pg,
63 <vscale x 8 x i16> %a,
64 <vscale x 8 x i16> %b,
65 <vscale x 8 x i16> %c)
66 ret <vscale x 8 x i16> %out
69 define <vscale x 4 x i32> @msb_i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, <vscale x 4 x i32> %c) {
70 ; CHECK-LABEL: msb_i32:
71 ; CHECK: msb z0.s, p0/m, z1.s, z2.s
73 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.msb.nxv4i32(<vscale x 4 x i1> %pg,
74 <vscale x 4 x i32> %a,
75 <vscale x 4 x i32> %b,
76 <vscale x 4 x i32> %c)
77 ret <vscale x 4 x i32> %out
80 define <vscale x 2 x i64> @msb_i64(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %a, <vscale x 2 x i64> %b, <vscale x 2 x i64> %c) {
81 ; CHECK-LABEL: msb_i64:
82 ; CHECK: msb z0.d, p0/m, z1.d, z2.d
84 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.msb.nxv2i64(<vscale x 2 x i1> %pg,
85 <vscale x 2 x i64> %a,
86 <vscale x 2 x i64> %b,
87 <vscale x 2 x i64> %c)
88 ret <vscale x 2 x i64> %out
92 define <vscale x 16 x i8> @mla_i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> %b, <vscale x 16 x i8> %c) {
93 ; CHECK-LABEL: mla_i8:
94 ; CHECK: mla z0.b, p0/m, z1.b, z2.b
96 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.mla.nxv16i8(<vscale x 16 x i1> %pg,
97 <vscale x 16 x i8> %a,
98 <vscale x 16 x i8> %b,
99 <vscale x 16 x i8> %c)
100 ret <vscale x 16 x i8> %out
103 define <vscale x 8 x i16> @mla_i16(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b, <vscale x 8 x i16> %c) {
104 ; CHECK-LABEL: mla_i16:
105 ; CHECK: mla z0.h, p0/m, z1.h, z2.h
107 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.mla.nxv8i16(<vscale x 8 x i1> %pg,
108 <vscale x 8 x i16> %a,
109 <vscale x 8 x i16> %b,
110 <vscale x 8 x i16> %c)
111 ret <vscale x 8 x i16> %out
114 define <vscale x 4 x i32> @mla_i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, <vscale x 4 x i32> %c) {
115 ; CHECK-LABEL: mla_i32:
116 ; CHECK: mla z0.s, p0/m, z1.s, z2.s
118 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.mla.nxv4i32(<vscale x 4 x i1> %pg,
119 <vscale x 4 x i32> %a,
120 <vscale x 4 x i32> %b,
121 <vscale x 4 x i32> %c)
122 ret <vscale x 4 x i32> %out
125 define <vscale x 2 x i64> @mla_i64(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %a, <vscale x 2 x i64> %b, <vscale x 2 x i64> %c) {
126 ; CHECK-LABEL: mla_i64:
127 ; CHECK: mla z0.d, p0/m, z1.d, z2.d
129 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.mla.nxv2i64(<vscale x 2 x i1> %pg,
130 <vscale x 2 x i64> %a,
131 <vscale x 2 x i64> %b,
132 <vscale x 2 x i64> %c)
133 ret <vscale x 2 x i64> %out
137 define <vscale x 16 x i8> @mls_i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> %b, <vscale x 16 x i8> %c) {
138 ; CHECK-LABEL: mls_i8:
139 ; CHECK: mls z0.b, p0/m, z1.b, z2.b
141 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.mls.nxv16i8(<vscale x 16 x i1> %pg,
142 <vscale x 16 x i8> %a,
143 <vscale x 16 x i8> %b,
144 <vscale x 16 x i8> %c)
145 ret <vscale x 16 x i8> %out
148 define <vscale x 8 x i16> @mls_i16(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b, <vscale x 8 x i16> %c) {
149 ; CHECK-LABEL: mls_i16:
150 ; CHECK: mls z0.h, p0/m, z1.h, z2.h
152 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.mls.nxv8i16(<vscale x 8 x i1> %pg,
153 <vscale x 8 x i16> %a,
154 <vscale x 8 x i16> %b,
155 <vscale x 8 x i16> %c)
156 ret <vscale x 8 x i16> %out
159 define <vscale x 4 x i32> @mls_i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, <vscale x 4 x i32> %c) {
160 ; CHECK-LABEL: mls_i32:
161 ; CHECK: mls z0.s, p0/m, z1.s, z2.s
163 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.mls.nxv4i32(<vscale x 4 x i1> %pg,
164 <vscale x 4 x i32> %a,
165 <vscale x 4 x i32> %b,
166 <vscale x 4 x i32> %c)
167 ret <vscale x 4 x i32> %out
170 define <vscale x 2 x i64> @mls_i64(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %a, <vscale x 2 x i64> %b, <vscale x 2 x i64> %c) {
171 ; CHECK-LABEL: mls_i64:
172 ; CHECK: mls z0.d, p0/m, z1.d, z2.d
174 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.mls.nxv2i64(<vscale x 2 x i1> %pg,
175 <vscale x 2 x i64> %a,
176 <vscale x 2 x i64> %b,
177 <vscale x 2 x i64> %c)
178 ret <vscale x 2 x i64> %out
181 declare <vscale x 16 x i8> @llvm.aarch64.sve.mad.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>,<vscale x 16 x i8>,<vscale x 16 x i8>)
182 declare <vscale x 8 x i16> @llvm.aarch64.sve.mad.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>,<vscale x 8 x i16>,<vscale x 8 x i16>)
183 declare <vscale x 4 x i32> @llvm.aarch64.sve.mad.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>,<vscale x 4 x i32>,<vscale x 4 x i32>)
184 declare <vscale x 2 x i64> @llvm.aarch64.sve.mad.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>,<vscale x 2 x i64>,<vscale x 2 x i64>)
186 declare <vscale x 16 x i8> @llvm.aarch64.sve.msb.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>,<vscale x 16 x i8>,<vscale x 16 x i8>)
187 declare <vscale x 8 x i16> @llvm.aarch64.sve.msb.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>,<vscale x 8 x i16>,<vscale x 8 x i16>)
188 declare <vscale x 4 x i32> @llvm.aarch64.sve.msb.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>,<vscale x 4 x i32>,<vscale x 4 x i32>)
189 declare <vscale x 2 x i64> @llvm.aarch64.sve.msb.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>,<vscale x 2 x i64>,<vscale x 2 x i64>)
191 declare <vscale x 16 x i8> @llvm.aarch64.sve.mla.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>,<vscale x 16 x i8>,<vscale x 16 x i8>)
192 declare <vscale x 8 x i16> @llvm.aarch64.sve.mla.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>,<vscale x 8 x i16>,<vscale x 8 x i16>)
193 declare <vscale x 4 x i32> @llvm.aarch64.sve.mla.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>,<vscale x 4 x i32>,<vscale x 4 x i32>)
194 declare <vscale x 2 x i64> @llvm.aarch64.sve.mla.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>,<vscale x 2 x i64>,<vscale x 2 x i64>)
196 declare <vscale x 16 x i8> @llvm.aarch64.sve.mls.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>,<vscale x 16 x i8>,<vscale x 16 x i8>)
197 declare <vscale x 8 x i16> @llvm.aarch64.sve.mls.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>,<vscale x 8 x i16>,<vscale x 8 x i16>)
198 declare <vscale x 4 x i32> @llvm.aarch64.sve.mls.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>,<vscale x 4 x i32>,<vscale x 4 x i32>)
199 declare <vscale x 2 x i64> @llvm.aarch64.sve.mls.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>,<vscale x 2 x i64>,<vscale x 2 x i64>)