1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch64 --mattr=+lsx < %s | FileCheck %s
4 declare <8 x i16> @llvm.loongarch.lsx.vaddwev.h.b(<16 x i8>, <16 x i8>)
6 define <8 x i16> @lsx_vaddwev_h_b(<16 x i8> %va, <16 x i8> %vb) nounwind {
7 ; CHECK-LABEL: lsx_vaddwev_h_b:
8 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: vaddwev.h.b $vr0, $vr0, $vr1
12 %res = call <8 x i16> @llvm.loongarch.lsx.vaddwev.h.b(<16 x i8> %va, <16 x i8> %vb)
16 declare <4 x i32> @llvm.loongarch.lsx.vaddwev.w.h(<8 x i16>, <8 x i16>)
18 define <4 x i32> @lsx_vaddwev_w_h(<8 x i16> %va, <8 x i16> %vb) nounwind {
19 ; CHECK-LABEL: lsx_vaddwev_w_h:
20 ; CHECK: # %bb.0: # %entry
21 ; CHECK-NEXT: vaddwev.w.h $vr0, $vr0, $vr1
24 %res = call <4 x i32> @llvm.loongarch.lsx.vaddwev.w.h(<8 x i16> %va, <8 x i16> %vb)
28 declare <2 x i64> @llvm.loongarch.lsx.vaddwev.d.w(<4 x i32>, <4 x i32>)
30 define <2 x i64> @lsx_vaddwev_d_w(<4 x i32> %va, <4 x i32> %vb) nounwind {
31 ; CHECK-LABEL: lsx_vaddwev_d_w:
32 ; CHECK: # %bb.0: # %entry
33 ; CHECK-NEXT: vaddwev.d.w $vr0, $vr0, $vr1
36 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwev.d.w(<4 x i32> %va, <4 x i32> %vb)
40 declare <2 x i64> @llvm.loongarch.lsx.vaddwev.q.d(<2 x i64>, <2 x i64>)
42 define <2 x i64> @lsx_vaddwev_q_d(<2 x i64> %va, <2 x i64> %vb) nounwind {
43 ; CHECK-LABEL: lsx_vaddwev_q_d:
44 ; CHECK: # %bb.0: # %entry
45 ; CHECK-NEXT: vaddwev.q.d $vr0, $vr0, $vr1
48 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwev.q.d(<2 x i64> %va, <2 x i64> %vb)
52 declare <8 x i16> @llvm.loongarch.lsx.vaddwev.h.bu(<16 x i8>, <16 x i8>)
54 define <8 x i16> @lsx_vaddwev_h_bu(<16 x i8> %va, <16 x i8> %vb) nounwind {
55 ; CHECK-LABEL: lsx_vaddwev_h_bu:
56 ; CHECK: # %bb.0: # %entry
57 ; CHECK-NEXT: vaddwev.h.bu $vr0, $vr0, $vr1
60 %res = call <8 x i16> @llvm.loongarch.lsx.vaddwev.h.bu(<16 x i8> %va, <16 x i8> %vb)
64 declare <4 x i32> @llvm.loongarch.lsx.vaddwev.w.hu(<8 x i16>, <8 x i16>)
66 define <4 x i32> @lsx_vaddwev_w_hu(<8 x i16> %va, <8 x i16> %vb) nounwind {
67 ; CHECK-LABEL: lsx_vaddwev_w_hu:
68 ; CHECK: # %bb.0: # %entry
69 ; CHECK-NEXT: vaddwev.w.hu $vr0, $vr0, $vr1
72 %res = call <4 x i32> @llvm.loongarch.lsx.vaddwev.w.hu(<8 x i16> %va, <8 x i16> %vb)
76 declare <2 x i64> @llvm.loongarch.lsx.vaddwev.d.wu(<4 x i32>, <4 x i32>)
78 define <2 x i64> @lsx_vaddwev_d_wu(<4 x i32> %va, <4 x i32> %vb) nounwind {
79 ; CHECK-LABEL: lsx_vaddwev_d_wu:
80 ; CHECK: # %bb.0: # %entry
81 ; CHECK-NEXT: vaddwev.d.wu $vr0, $vr0, $vr1
84 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwev.d.wu(<4 x i32> %va, <4 x i32> %vb)
88 declare <2 x i64> @llvm.loongarch.lsx.vaddwev.q.du(<2 x i64>, <2 x i64>)
90 define <2 x i64> @lsx_vaddwev_q_du(<2 x i64> %va, <2 x i64> %vb) nounwind {
91 ; CHECK-LABEL: lsx_vaddwev_q_du:
92 ; CHECK: # %bb.0: # %entry
93 ; CHECK-NEXT: vaddwev.q.du $vr0, $vr0, $vr1
96 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwev.q.du(<2 x i64> %va, <2 x i64> %vb)
100 declare <8 x i16> @llvm.loongarch.lsx.vaddwev.h.bu.b(<16 x i8>, <16 x i8>)
102 define <8 x i16> @lsx_vaddwev_h_bu_b(<16 x i8> %va, <16 x i8> %vb) nounwind {
103 ; CHECK-LABEL: lsx_vaddwev_h_bu_b:
104 ; CHECK: # %bb.0: # %entry
105 ; CHECK-NEXT: vaddwev.h.bu.b $vr0, $vr0, $vr1
108 %res = call <8 x i16> @llvm.loongarch.lsx.vaddwev.h.bu.b(<16 x i8> %va, <16 x i8> %vb)
112 declare <4 x i32> @llvm.loongarch.lsx.vaddwev.w.hu.h(<8 x i16>, <8 x i16>)
114 define <4 x i32> @lsx_vaddwev_w_hu_h(<8 x i16> %va, <8 x i16> %vb) nounwind {
115 ; CHECK-LABEL: lsx_vaddwev_w_hu_h:
116 ; CHECK: # %bb.0: # %entry
117 ; CHECK-NEXT: vaddwev.w.hu.h $vr0, $vr0, $vr1
120 %res = call <4 x i32> @llvm.loongarch.lsx.vaddwev.w.hu.h(<8 x i16> %va, <8 x i16> %vb)
124 declare <2 x i64> @llvm.loongarch.lsx.vaddwev.d.wu.w(<4 x i32>, <4 x i32>)
126 define <2 x i64> @lsx_vaddwev_d_wu_w(<4 x i32> %va, <4 x i32> %vb) nounwind {
127 ; CHECK-LABEL: lsx_vaddwev_d_wu_w:
128 ; CHECK: # %bb.0: # %entry
129 ; CHECK-NEXT: vaddwev.d.wu.w $vr0, $vr0, $vr1
132 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwev.d.wu.w(<4 x i32> %va, <4 x i32> %vb)
136 declare <2 x i64> @llvm.loongarch.lsx.vaddwev.q.du.d(<2 x i64>, <2 x i64>)
138 define <2 x i64> @lsx_vaddwev_q_du_d(<2 x i64> %va, <2 x i64> %vb) nounwind {
139 ; CHECK-LABEL: lsx_vaddwev_q_du_d:
140 ; CHECK: # %bb.0: # %entry
141 ; CHECK-NEXT: vaddwev.q.du.d $vr0, $vr0, $vr1
144 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwev.q.du.d(<2 x i64> %va, <2 x i64> %vb)
148 declare <8 x i16> @llvm.loongarch.lsx.vaddwod.h.b(<16 x i8>, <16 x i8>)
150 define <8 x i16> @lsx_vaddwod_h_b(<16 x i8> %va, <16 x i8> %vb) nounwind {
151 ; CHECK-LABEL: lsx_vaddwod_h_b:
152 ; CHECK: # %bb.0: # %entry
153 ; CHECK-NEXT: vaddwod.h.b $vr0, $vr0, $vr1
156 %res = call <8 x i16> @llvm.loongarch.lsx.vaddwod.h.b(<16 x i8> %va, <16 x i8> %vb)
160 declare <4 x i32> @llvm.loongarch.lsx.vaddwod.w.h(<8 x i16>, <8 x i16>)
162 define <4 x i32> @lsx_vaddwod_w_h(<8 x i16> %va, <8 x i16> %vb) nounwind {
163 ; CHECK-LABEL: lsx_vaddwod_w_h:
164 ; CHECK: # %bb.0: # %entry
165 ; CHECK-NEXT: vaddwod.w.h $vr0, $vr0, $vr1
168 %res = call <4 x i32> @llvm.loongarch.lsx.vaddwod.w.h(<8 x i16> %va, <8 x i16> %vb)
172 declare <2 x i64> @llvm.loongarch.lsx.vaddwod.d.w(<4 x i32>, <4 x i32>)
174 define <2 x i64> @lsx_vaddwod_d_w(<4 x i32> %va, <4 x i32> %vb) nounwind {
175 ; CHECK-LABEL: lsx_vaddwod_d_w:
176 ; CHECK: # %bb.0: # %entry
177 ; CHECK-NEXT: vaddwod.d.w $vr0, $vr0, $vr1
180 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwod.d.w(<4 x i32> %va, <4 x i32> %vb)
184 declare <2 x i64> @llvm.loongarch.lsx.vaddwod.q.d(<2 x i64>, <2 x i64>)
186 define <2 x i64> @lsx_vaddwod_q_d(<2 x i64> %va, <2 x i64> %vb) nounwind {
187 ; CHECK-LABEL: lsx_vaddwod_q_d:
188 ; CHECK: # %bb.0: # %entry
189 ; CHECK-NEXT: vaddwod.q.d $vr0, $vr0, $vr1
192 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwod.q.d(<2 x i64> %va, <2 x i64> %vb)
196 declare <8 x i16> @llvm.loongarch.lsx.vaddwod.h.bu(<16 x i8>, <16 x i8>)
198 define <8 x i16> @lsx_vaddwod_h_bu(<16 x i8> %va, <16 x i8> %vb) nounwind {
199 ; CHECK-LABEL: lsx_vaddwod_h_bu:
200 ; CHECK: # %bb.0: # %entry
201 ; CHECK-NEXT: vaddwod.h.bu $vr0, $vr0, $vr1
204 %res = call <8 x i16> @llvm.loongarch.lsx.vaddwod.h.bu(<16 x i8> %va, <16 x i8> %vb)
208 declare <4 x i32> @llvm.loongarch.lsx.vaddwod.w.hu(<8 x i16>, <8 x i16>)
210 define <4 x i32> @lsx_vaddwod_w_hu(<8 x i16> %va, <8 x i16> %vb) nounwind {
211 ; CHECK-LABEL: lsx_vaddwod_w_hu:
212 ; CHECK: # %bb.0: # %entry
213 ; CHECK-NEXT: vaddwod.w.hu $vr0, $vr0, $vr1
216 %res = call <4 x i32> @llvm.loongarch.lsx.vaddwod.w.hu(<8 x i16> %va, <8 x i16> %vb)
220 declare <2 x i64> @llvm.loongarch.lsx.vaddwod.d.wu(<4 x i32>, <4 x i32>)
222 define <2 x i64> @lsx_vaddwod_d_wu(<4 x i32> %va, <4 x i32> %vb) nounwind {
223 ; CHECK-LABEL: lsx_vaddwod_d_wu:
224 ; CHECK: # %bb.0: # %entry
225 ; CHECK-NEXT: vaddwod.d.wu $vr0, $vr0, $vr1
228 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwod.d.wu(<4 x i32> %va, <4 x i32> %vb)
232 declare <2 x i64> @llvm.loongarch.lsx.vaddwod.q.du(<2 x i64>, <2 x i64>)
234 define <2 x i64> @lsx_vaddwod_q_du(<2 x i64> %va, <2 x i64> %vb) nounwind {
235 ; CHECK-LABEL: lsx_vaddwod_q_du:
236 ; CHECK: # %bb.0: # %entry
237 ; CHECK-NEXT: vaddwod.q.du $vr0, $vr0, $vr1
240 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwod.q.du(<2 x i64> %va, <2 x i64> %vb)
244 declare <8 x i16> @llvm.loongarch.lsx.vaddwod.h.bu.b(<16 x i8>, <16 x i8>)
246 define <8 x i16> @lsx_vaddwod_h_bu_b(<16 x i8> %va, <16 x i8> %vb) nounwind {
247 ; CHECK-LABEL: lsx_vaddwod_h_bu_b:
248 ; CHECK: # %bb.0: # %entry
249 ; CHECK-NEXT: vaddwod.h.bu.b $vr0, $vr0, $vr1
252 %res = call <8 x i16> @llvm.loongarch.lsx.vaddwod.h.bu.b(<16 x i8> %va, <16 x i8> %vb)
256 declare <4 x i32> @llvm.loongarch.lsx.vaddwod.w.hu.h(<8 x i16>, <8 x i16>)
258 define <4 x i32> @lsx_vaddwod_w_hu_h(<8 x i16> %va, <8 x i16> %vb) nounwind {
259 ; CHECK-LABEL: lsx_vaddwod_w_hu_h:
260 ; CHECK: # %bb.0: # %entry
261 ; CHECK-NEXT: vaddwod.w.hu.h $vr0, $vr0, $vr1
264 %res = call <4 x i32> @llvm.loongarch.lsx.vaddwod.w.hu.h(<8 x i16> %va, <8 x i16> %vb)
268 declare <2 x i64> @llvm.loongarch.lsx.vaddwod.d.wu.w(<4 x i32>, <4 x i32>)
270 define <2 x i64> @lsx_vaddwod_d_wu_w(<4 x i32> %va, <4 x i32> %vb) nounwind {
271 ; CHECK-LABEL: lsx_vaddwod_d_wu_w:
272 ; CHECK: # %bb.0: # %entry
273 ; CHECK-NEXT: vaddwod.d.wu.w $vr0, $vr0, $vr1
276 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwod.d.wu.w(<4 x i32> %va, <4 x i32> %vb)
280 declare <2 x i64> @llvm.loongarch.lsx.vaddwod.q.du.d(<2 x i64>, <2 x i64>)
282 define <2 x i64> @lsx_vaddwod_q_du_d(<2 x i64> %va, <2 x i64> %vb) nounwind {
283 ; CHECK-LABEL: lsx_vaddwod_q_du_d:
284 ; CHECK: # %bb.0: # %entry
285 ; CHECK-NEXT: vaddwod.q.du.d $vr0, $vr0, $vr1
288 %res = call <2 x i64> @llvm.loongarch.lsx.vaddwod.q.du.d(<2 x i64> %va, <2 x i64> %vb)