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 <4 x i32> @llvm.loongarch.lsx.vftintrne.w.s(<4 x float>)
6 define <4 x i32> @lsx_vftintrne_w_s(<4 x float> %va) nounwind {
7 ; CHECK-LABEL: lsx_vftintrne_w_s:
8 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: vftintrne.w.s $vr0, $vr0
12 %res = call <4 x i32> @llvm.loongarch.lsx.vftintrne.w.s(<4 x float> %va)
16 declare <2 x i64> @llvm.loongarch.lsx.vftintrne.l.d(<2 x double>)
18 define <2 x i64> @lsx_vftintrne_l_d(<2 x double> %va) nounwind {
19 ; CHECK-LABEL: lsx_vftintrne_l_d:
20 ; CHECK: # %bb.0: # %entry
21 ; CHECK-NEXT: vftintrne.l.d $vr0, $vr0
24 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrne.l.d(<2 x double> %va)
28 declare <4 x i32> @llvm.loongarch.lsx.vftintrz.w.s(<4 x float>)
30 define <4 x i32> @lsx_vftintrz_w_s(<4 x float> %va) nounwind {
31 ; CHECK-LABEL: lsx_vftintrz_w_s:
32 ; CHECK: # %bb.0: # %entry
33 ; CHECK-NEXT: vftintrz.w.s $vr0, $vr0
36 %res = call <4 x i32> @llvm.loongarch.lsx.vftintrz.w.s(<4 x float> %va)
40 declare <2 x i64> @llvm.loongarch.lsx.vftintrz.l.d(<2 x double>)
42 define <2 x i64> @lsx_vftintrz_l_d(<2 x double> %va) nounwind {
43 ; CHECK-LABEL: lsx_vftintrz_l_d:
44 ; CHECK: # %bb.0: # %entry
45 ; CHECK-NEXT: vftintrz.l.d $vr0, $vr0
48 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrz.l.d(<2 x double> %va)
52 declare <4 x i32> @llvm.loongarch.lsx.vftintrp.w.s(<4 x float>)
54 define <4 x i32> @lsx_vftintrp_w_s(<4 x float> %va) nounwind {
55 ; CHECK-LABEL: lsx_vftintrp_w_s:
56 ; CHECK: # %bb.0: # %entry
57 ; CHECK-NEXT: vftintrp.w.s $vr0, $vr0
60 %res = call <4 x i32> @llvm.loongarch.lsx.vftintrp.w.s(<4 x float> %va)
64 declare <2 x i64> @llvm.loongarch.lsx.vftintrp.l.d(<2 x double>)
66 define <2 x i64> @lsx_vftintrp_l_d(<2 x double> %va) nounwind {
67 ; CHECK-LABEL: lsx_vftintrp_l_d:
68 ; CHECK: # %bb.0: # %entry
69 ; CHECK-NEXT: vftintrp.l.d $vr0, $vr0
72 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrp.l.d(<2 x double> %va)
76 declare <4 x i32> @llvm.loongarch.lsx.vftintrm.w.s(<4 x float>)
78 define <4 x i32> @lsx_vftintrm_w_s(<4 x float> %va) nounwind {
79 ; CHECK-LABEL: lsx_vftintrm_w_s:
80 ; CHECK: # %bb.0: # %entry
81 ; CHECK-NEXT: vftintrm.w.s $vr0, $vr0
84 %res = call <4 x i32> @llvm.loongarch.lsx.vftintrm.w.s(<4 x float> %va)
88 declare <2 x i64> @llvm.loongarch.lsx.vftintrm.l.d(<2 x double>)
90 define <2 x i64> @lsx_vftintrm_l_d(<2 x double> %va) nounwind {
91 ; CHECK-LABEL: lsx_vftintrm_l_d:
92 ; CHECK: # %bb.0: # %entry
93 ; CHECK-NEXT: vftintrm.l.d $vr0, $vr0
96 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrm.l.d(<2 x double> %va)
100 declare <4 x i32> @llvm.loongarch.lsx.vftint.w.s(<4 x float>)
102 define <4 x i32> @lsx_vftint_w_s(<4 x float> %va) nounwind {
103 ; CHECK-LABEL: lsx_vftint_w_s:
104 ; CHECK: # %bb.0: # %entry
105 ; CHECK-NEXT: vftint.w.s $vr0, $vr0
108 %res = call <4 x i32> @llvm.loongarch.lsx.vftint.w.s(<4 x float> %va)
112 declare <2 x i64> @llvm.loongarch.lsx.vftint.l.d(<2 x double>)
114 define <2 x i64> @lsx_vftint_l_d(<2 x double> %va) nounwind {
115 ; CHECK-LABEL: lsx_vftint_l_d:
116 ; CHECK: # %bb.0: # %entry
117 ; CHECK-NEXT: vftint.l.d $vr0, $vr0
120 %res = call <2 x i64> @llvm.loongarch.lsx.vftint.l.d(<2 x double> %va)
124 declare <4 x i32> @llvm.loongarch.lsx.vftintrz.wu.s(<4 x float>)
126 define <4 x i32> @lsx_vftintrz_wu_s(<4 x float> %va) nounwind {
127 ; CHECK-LABEL: lsx_vftintrz_wu_s:
128 ; CHECK: # %bb.0: # %entry
129 ; CHECK-NEXT: vftintrz.wu.s $vr0, $vr0
132 %res = call <4 x i32> @llvm.loongarch.lsx.vftintrz.wu.s(<4 x float> %va)
136 declare <2 x i64> @llvm.loongarch.lsx.vftintrz.lu.d(<2 x double>)
138 define <2 x i64> @lsx_vftintrz_lu_d(<2 x double> %va) nounwind {
139 ; CHECK-LABEL: lsx_vftintrz_lu_d:
140 ; CHECK: # %bb.0: # %entry
141 ; CHECK-NEXT: vftintrz.lu.d $vr0, $vr0
144 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrz.lu.d(<2 x double> %va)
148 declare <4 x i32> @llvm.loongarch.lsx.vftint.wu.s(<4 x float>)
150 define <4 x i32> @lsx_vftint_wu_s(<4 x float> %va) nounwind {
151 ; CHECK-LABEL: lsx_vftint_wu_s:
152 ; CHECK: # %bb.0: # %entry
153 ; CHECK-NEXT: vftint.wu.s $vr0, $vr0
156 %res = call <4 x i32> @llvm.loongarch.lsx.vftint.wu.s(<4 x float> %va)
160 declare <2 x i64> @llvm.loongarch.lsx.vftint.lu.d(<2 x double>)
162 define <2 x i64> @lsx_vftint_lu_d(<2 x double> %va) nounwind {
163 ; CHECK-LABEL: lsx_vftint_lu_d:
164 ; CHECK: # %bb.0: # %entry
165 ; CHECK-NEXT: vftint.lu.d $vr0, $vr0
168 %res = call <2 x i64> @llvm.loongarch.lsx.vftint.lu.d(<2 x double> %va)
172 declare <4 x i32> @llvm.loongarch.lsx.vftintrne.w.d(<2 x double>, <2 x double>)
174 define <4 x i32> @lsx_vftintrne_w_d(<2 x double> %va, <2 x double> %vb) nounwind {
175 ; CHECK-LABEL: lsx_vftintrne_w_d:
176 ; CHECK: # %bb.0: # %entry
177 ; CHECK-NEXT: vftintrne.w.d $vr0, $vr0, $vr1
180 %res = call <4 x i32> @llvm.loongarch.lsx.vftintrne.w.d(<2 x double> %va, <2 x double> %vb)
184 declare <4 x i32> @llvm.loongarch.lsx.vftintrz.w.d(<2 x double>, <2 x double>)
186 define <4 x i32> @lsx_vftintrz_w_d(<2 x double> %va, <2 x double> %vb) nounwind {
187 ; CHECK-LABEL: lsx_vftintrz_w_d:
188 ; CHECK: # %bb.0: # %entry
189 ; CHECK-NEXT: vftintrz.w.d $vr0, $vr0, $vr1
192 %res = call <4 x i32> @llvm.loongarch.lsx.vftintrz.w.d(<2 x double> %va, <2 x double> %vb)
196 declare <4 x i32> @llvm.loongarch.lsx.vftintrp.w.d(<2 x double>, <2 x double>)
198 define <4 x i32> @lsx_vftintrp_w_d(<2 x double> %va, <2 x double> %vb) nounwind {
199 ; CHECK-LABEL: lsx_vftintrp_w_d:
200 ; CHECK: # %bb.0: # %entry
201 ; CHECK-NEXT: vftintrp.w.d $vr0, $vr0, $vr1
204 %res = call <4 x i32> @llvm.loongarch.lsx.vftintrp.w.d(<2 x double> %va, <2 x double> %vb)
208 declare <4 x i32> @llvm.loongarch.lsx.vftintrm.w.d(<2 x double>, <2 x double>)
210 define <4 x i32> @lsx_vftintrm_w_d(<2 x double> %va, <2 x double> %vb) nounwind {
211 ; CHECK-LABEL: lsx_vftintrm_w_d:
212 ; CHECK: # %bb.0: # %entry
213 ; CHECK-NEXT: vftintrm.w.d $vr0, $vr0, $vr1
216 %res = call <4 x i32> @llvm.loongarch.lsx.vftintrm.w.d(<2 x double> %va, <2 x double> %vb)
220 declare <4 x i32> @llvm.loongarch.lsx.vftint.w.d(<2 x double>, <2 x double>)
222 define <4 x i32> @lsx_vftint_w_d(<2 x double> %va, <2 x double> %vb) nounwind {
223 ; CHECK-LABEL: lsx_vftint_w_d:
224 ; CHECK: # %bb.0: # %entry
225 ; CHECK-NEXT: vftint.w.d $vr0, $vr0, $vr1
228 %res = call <4 x i32> @llvm.loongarch.lsx.vftint.w.d(<2 x double> %va, <2 x double> %vb)
232 declare <2 x i64> @llvm.loongarch.lsx.vftintrnel.l.s(<4 x float>)
234 define <2 x i64> @lsx_vftintrnel_l_s(<4 x float> %va) nounwind {
235 ; CHECK-LABEL: lsx_vftintrnel_l_s:
236 ; CHECK: # %bb.0: # %entry
237 ; CHECK-NEXT: vftintrnel.l.s $vr0, $vr0
240 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrnel.l.s(<4 x float> %va)
244 declare <2 x i64> @llvm.loongarch.lsx.vftintrneh.l.s(<4 x float>)
246 define <2 x i64> @lsx_vftintrneh_l_s(<4 x float> %va) nounwind {
247 ; CHECK-LABEL: lsx_vftintrneh_l_s:
248 ; CHECK: # %bb.0: # %entry
249 ; CHECK-NEXT: vftintrneh.l.s $vr0, $vr0
252 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrneh.l.s(<4 x float> %va)
256 declare <2 x i64> @llvm.loongarch.lsx.vftintrzl.l.s(<4 x float>)
258 define <2 x i64> @lsx_vftintrzl_l_s(<4 x float> %va) nounwind {
259 ; CHECK-LABEL: lsx_vftintrzl_l_s:
260 ; CHECK: # %bb.0: # %entry
261 ; CHECK-NEXT: vftintrzl.l.s $vr0, $vr0
264 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrzl.l.s(<4 x float> %va)
268 declare <2 x i64> @llvm.loongarch.lsx.vftintrzh.l.s(<4 x float>)
270 define <2 x i64> @lsx_vftintrzh_l_s(<4 x float> %va) nounwind {
271 ; CHECK-LABEL: lsx_vftintrzh_l_s:
272 ; CHECK: # %bb.0: # %entry
273 ; CHECK-NEXT: vftintrzh.l.s $vr0, $vr0
276 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrzh.l.s(<4 x float> %va)
280 declare <2 x i64> @llvm.loongarch.lsx.vftintrpl.l.s(<4 x float>)
282 define <2 x i64> @lsx_vftintrpl_l_s(<4 x float> %va) nounwind {
283 ; CHECK-LABEL: lsx_vftintrpl_l_s:
284 ; CHECK: # %bb.0: # %entry
285 ; CHECK-NEXT: vftintrpl.l.s $vr0, $vr0
288 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrpl.l.s(<4 x float> %va)
292 declare <2 x i64> @llvm.loongarch.lsx.vftintrph.l.s(<4 x float>)
294 define <2 x i64> @lsx_vftintrph_l_s(<4 x float> %va) nounwind {
295 ; CHECK-LABEL: lsx_vftintrph_l_s:
296 ; CHECK: # %bb.0: # %entry
297 ; CHECK-NEXT: vftintrph.l.s $vr0, $vr0
300 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrph.l.s(<4 x float> %va)
304 declare <2 x i64> @llvm.loongarch.lsx.vftintrml.l.s(<4 x float>)
306 define <2 x i64> @lsx_vftintrml_l_s(<4 x float> %va) nounwind {
307 ; CHECK-LABEL: lsx_vftintrml_l_s:
308 ; CHECK: # %bb.0: # %entry
309 ; CHECK-NEXT: vftintrml.l.s $vr0, $vr0
312 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrml.l.s(<4 x float> %va)
316 declare <2 x i64> @llvm.loongarch.lsx.vftintrmh.l.s(<4 x float>)
318 define <2 x i64> @lsx_vftintrmh_l_s(<4 x float> %va) nounwind {
319 ; CHECK-LABEL: lsx_vftintrmh_l_s:
320 ; CHECK: # %bb.0: # %entry
321 ; CHECK-NEXT: vftintrmh.l.s $vr0, $vr0
324 %res = call <2 x i64> @llvm.loongarch.lsx.vftintrmh.l.s(<4 x float> %va)
328 declare <2 x i64> @llvm.loongarch.lsx.vftintl.l.s(<4 x float>)
330 define <2 x i64> @lsx_vftintl_l_s(<4 x float> %va) nounwind {
331 ; CHECK-LABEL: lsx_vftintl_l_s:
332 ; CHECK: # %bb.0: # %entry
333 ; CHECK-NEXT: vftintl.l.s $vr0, $vr0
336 %res = call <2 x i64> @llvm.loongarch.lsx.vftintl.l.s(<4 x float> %va)
340 declare <2 x i64> @llvm.loongarch.lsx.vftinth.l.s(<4 x float>)
342 define <2 x i64> @lsx_vftinth_l_s(<4 x float> %va) nounwind {
343 ; CHECK-LABEL: lsx_vftinth_l_s:
344 ; CHECK: # %bb.0: # %entry
345 ; CHECK-NEXT: vftinth.l.s $vr0, $vr0
348 %res = call <2 x i64> @llvm.loongarch.lsx.vftinth.l.s(<4 x float> %va)