xref: /llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfrdiv-vp.ll (revision 1cb599835ccf7ee8b2d1d5a7f3107e19a26fc6f5)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=riscv32 -mattr=+d,+zvfh,+v -target-abi=ilp32d \
3; RUN:   -verify-machineinstrs < %s | FileCheck %s
4; RUN: llc -mtriple=riscv64 -mattr=+d,+zvfh,+v -target-abi=lp64d \
5; RUN:   -verify-machineinstrs < %s | FileCheck %s
6
7declare <2 x half> @llvm.vp.fdiv.v2f16(<2 x half>, <2 x half>, <2 x i1>, i32)
8
9define <2 x half> @vfrdiv_vf_v2f16(<2 x half> %va, half %b, <2 x i1> %m, i32 zeroext %evl) {
10; CHECK-LABEL: vfrdiv_vf_v2f16:
11; CHECK:       # %bb.0:
12; CHECK-NEXT:    vsetvli zero, a0, e16, mf4, ta, ma
13; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
14; CHECK-NEXT:    ret
15  %elt.head = insertelement <2 x half> poison, half %b, i32 0
16  %vb = shufflevector <2 x half> %elt.head, <2 x half> poison, <2 x i32> zeroinitializer
17  %v = call <2 x half> @llvm.vp.fdiv.v2f16(<2 x half> %vb, <2 x half> %va, <2 x i1> %m, i32 %evl)
18  ret <2 x half> %v
19}
20
21define <2 x half> @vfrdiv_vf_v2f16_unmasked(<2 x half> %va, half %b, i32 zeroext %evl) {
22; CHECK-LABEL: vfrdiv_vf_v2f16_unmasked:
23; CHECK:       # %bb.0:
24; CHECK-NEXT:    vsetvli zero, a0, e16, mf4, ta, ma
25; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
26; CHECK-NEXT:    ret
27  %elt.head = insertelement <2 x half> poison, half %b, i32 0
28  %vb = shufflevector <2 x half> %elt.head, <2 x half> poison, <2 x i32> zeroinitializer
29  %v = call <2 x half> @llvm.vp.fdiv.v2f16(<2 x half> %vb, <2 x half> %va, <2 x i1> splat (i1 true), i32 %evl)
30  ret <2 x half> %v
31}
32
33declare <4 x half> @llvm.vp.fdiv.v4f16(<4 x half>, <4 x half>, <4 x i1>, i32)
34
35define <4 x half> @vfrdiv_vf_v4f16(<4 x half> %va, half %b, <4 x i1> %m, i32 zeroext %evl) {
36; CHECK-LABEL: vfrdiv_vf_v4f16:
37; CHECK:       # %bb.0:
38; CHECK-NEXT:    vsetvli zero, a0, e16, mf2, ta, ma
39; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
40; CHECK-NEXT:    ret
41  %elt.head = insertelement <4 x half> poison, half %b, i32 0
42  %vb = shufflevector <4 x half> %elt.head, <4 x half> poison, <4 x i32> zeroinitializer
43  %v = call <4 x half> @llvm.vp.fdiv.v4f16(<4 x half> %vb, <4 x half> %va, <4 x i1> %m, i32 %evl)
44  ret <4 x half> %v
45}
46
47define <4 x half> @vfrdiv_vf_v4f16_unmasked(<4 x half> %va, half %b, i32 zeroext %evl) {
48; CHECK-LABEL: vfrdiv_vf_v4f16_unmasked:
49; CHECK:       # %bb.0:
50; CHECK-NEXT:    vsetvli zero, a0, e16, mf2, ta, ma
51; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
52; CHECK-NEXT:    ret
53  %elt.head = insertelement <4 x half> poison, half %b, i32 0
54  %vb = shufflevector <4 x half> %elt.head, <4 x half> poison, <4 x i32> zeroinitializer
55  %v = call <4 x half> @llvm.vp.fdiv.v4f16(<4 x half> %vb, <4 x half> %va, <4 x i1> splat (i1 true), i32 %evl)
56  ret <4 x half> %v
57}
58
59declare <8 x half> @llvm.vp.fdiv.v8f16(<8 x half>, <8 x half>, <8 x i1>, i32)
60
61define <8 x half> @vfrdiv_vf_v8f16(<8 x half> %va, half %b, <8 x i1> %m, i32 zeroext %evl) {
62; CHECK-LABEL: vfrdiv_vf_v8f16:
63; CHECK:       # %bb.0:
64; CHECK-NEXT:    vsetvli zero, a0, e16, m1, ta, ma
65; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
66; CHECK-NEXT:    ret
67  %elt.head = insertelement <8 x half> poison, half %b, i32 0
68  %vb = shufflevector <8 x half> %elt.head, <8 x half> poison, <8 x i32> zeroinitializer
69  %v = call <8 x half> @llvm.vp.fdiv.v8f16(<8 x half> %vb, <8 x half> %va, <8 x i1> %m, i32 %evl)
70  ret <8 x half> %v
71}
72
73define <8 x half> @vfrdiv_vf_v8f16_unmasked(<8 x half> %va, half %b, i32 zeroext %evl) {
74; CHECK-LABEL: vfrdiv_vf_v8f16_unmasked:
75; CHECK:       # %bb.0:
76; CHECK-NEXT:    vsetvli zero, a0, e16, m1, ta, ma
77; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
78; CHECK-NEXT:    ret
79  %elt.head = insertelement <8 x half> poison, half %b, i32 0
80  %vb = shufflevector <8 x half> %elt.head, <8 x half> poison, <8 x i32> zeroinitializer
81  %v = call <8 x half> @llvm.vp.fdiv.v8f16(<8 x half> %vb, <8 x half> %va, <8 x i1> splat (i1 true), i32 %evl)
82  ret <8 x half> %v
83}
84
85declare <16 x half> @llvm.vp.fdiv.v16f16(<16 x half>, <16 x half>, <16 x i1>, i32)
86
87define <16 x half> @vfrdiv_vf_v16f16(<16 x half> %va, half %b, <16 x i1> %m, i32 zeroext %evl) {
88; CHECK-LABEL: vfrdiv_vf_v16f16:
89; CHECK:       # %bb.0:
90; CHECK-NEXT:    vsetvli zero, a0, e16, m2, ta, ma
91; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
92; CHECK-NEXT:    ret
93  %elt.head = insertelement <16 x half> poison, half %b, i32 0
94  %vb = shufflevector <16 x half> %elt.head, <16 x half> poison, <16 x i32> zeroinitializer
95  %v = call <16 x half> @llvm.vp.fdiv.v16f16(<16 x half> %vb, <16 x half> %va, <16 x i1> %m, i32 %evl)
96  ret <16 x half> %v
97}
98
99define <16 x half> @vfrdiv_vf_v16f16_unmasked(<16 x half> %va, half %b, i32 zeroext %evl) {
100; CHECK-LABEL: vfrdiv_vf_v16f16_unmasked:
101; CHECK:       # %bb.0:
102; CHECK-NEXT:    vsetvli zero, a0, e16, m2, ta, ma
103; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
104; CHECK-NEXT:    ret
105  %elt.head = insertelement <16 x half> poison, half %b, i32 0
106  %vb = shufflevector <16 x half> %elt.head, <16 x half> poison, <16 x i32> zeroinitializer
107  %v = call <16 x half> @llvm.vp.fdiv.v16f16(<16 x half> %vb, <16 x half> %va, <16 x i1> splat (i1 true), i32 %evl)
108  ret <16 x half> %v
109}
110
111declare <2 x float> @llvm.vp.fdiv.v2f32(<2 x float>, <2 x float>, <2 x i1>, i32)
112
113define <2 x float> @vfrdiv_vf_v2f32(<2 x float> %va, float %b, <2 x i1> %m, i32 zeroext %evl) {
114; CHECK-LABEL: vfrdiv_vf_v2f32:
115; CHECK:       # %bb.0:
116; CHECK-NEXT:    vsetvli zero, a0, e32, mf2, ta, ma
117; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
118; CHECK-NEXT:    ret
119  %elt.head = insertelement <2 x float> poison, float %b, i32 0
120  %vb = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
121  %v = call <2 x float> @llvm.vp.fdiv.v2f32(<2 x float> %vb, <2 x float> %va, <2 x i1> %m, i32 %evl)
122  ret <2 x float> %v
123}
124
125define <2 x float> @vfrdiv_vf_v2f32_unmasked(<2 x float> %va, float %b, i32 zeroext %evl) {
126; CHECK-LABEL: vfrdiv_vf_v2f32_unmasked:
127; CHECK:       # %bb.0:
128; CHECK-NEXT:    vsetvli zero, a0, e32, mf2, ta, ma
129; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
130; CHECK-NEXT:    ret
131  %elt.head = insertelement <2 x float> poison, float %b, i32 0
132  %vb = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
133  %v = call <2 x float> @llvm.vp.fdiv.v2f32(<2 x float> %vb, <2 x float> %va, <2 x i1> splat (i1 true), i32 %evl)
134  ret <2 x float> %v
135}
136
137declare <4 x float> @llvm.vp.fdiv.v4f32(<4 x float>, <4 x float>, <4 x i1>, i32)
138
139define <4 x float> @vfrdiv_vf_v4f32(<4 x float> %va, float %b, <4 x i1> %m, i32 zeroext %evl) {
140; CHECK-LABEL: vfrdiv_vf_v4f32:
141; CHECK:       # %bb.0:
142; CHECK-NEXT:    vsetvli zero, a0, e32, m1, ta, ma
143; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
144; CHECK-NEXT:    ret
145  %elt.head = insertelement <4 x float> poison, float %b, i32 0
146  %vb = shufflevector <4 x float> %elt.head, <4 x float> poison, <4 x i32> zeroinitializer
147  %v = call <4 x float> @llvm.vp.fdiv.v4f32(<4 x float> %vb, <4 x float> %va, <4 x i1> %m, i32 %evl)
148  ret <4 x float> %v
149}
150
151define <4 x float> @vfrdiv_vf_v4f32_unmasked(<4 x float> %va, float %b, i32 zeroext %evl) {
152; CHECK-LABEL: vfrdiv_vf_v4f32_unmasked:
153; CHECK:       # %bb.0:
154; CHECK-NEXT:    vsetvli zero, a0, e32, m1, ta, ma
155; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
156; CHECK-NEXT:    ret
157  %elt.head = insertelement <4 x float> poison, float %b, i32 0
158  %vb = shufflevector <4 x float> %elt.head, <4 x float> poison, <4 x i32> zeroinitializer
159  %v = call <4 x float> @llvm.vp.fdiv.v4f32(<4 x float> %vb, <4 x float> %va, <4 x i1> splat (i1 true), i32 %evl)
160  ret <4 x float> %v
161}
162
163declare <8 x float> @llvm.vp.fdiv.v8f32(<8 x float>, <8 x float>, <8 x i1>, i32)
164
165define <8 x float> @vfrdiv_vf_v8f32(<8 x float> %va, float %b, <8 x i1> %m, i32 zeroext %evl) {
166; CHECK-LABEL: vfrdiv_vf_v8f32:
167; CHECK:       # %bb.0:
168; CHECK-NEXT:    vsetvli zero, a0, e32, m2, ta, ma
169; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
170; CHECK-NEXT:    ret
171  %elt.head = insertelement <8 x float> poison, float %b, i32 0
172  %vb = shufflevector <8 x float> %elt.head, <8 x float> poison, <8 x i32> zeroinitializer
173  %v = call <8 x float> @llvm.vp.fdiv.v8f32(<8 x float> %vb, <8 x float> %va, <8 x i1> %m, i32 %evl)
174  ret <8 x float> %v
175}
176
177define <8 x float> @vfrdiv_vf_v8f32_unmasked(<8 x float> %va, float %b, i32 zeroext %evl) {
178; CHECK-LABEL: vfrdiv_vf_v8f32_unmasked:
179; CHECK:       # %bb.0:
180; CHECK-NEXT:    vsetvli zero, a0, e32, m2, ta, ma
181; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
182; CHECK-NEXT:    ret
183  %elt.head = insertelement <8 x float> poison, float %b, i32 0
184  %vb = shufflevector <8 x float> %elt.head, <8 x float> poison, <8 x i32> zeroinitializer
185  %v = call <8 x float> @llvm.vp.fdiv.v8f32(<8 x float> %vb, <8 x float> %va, <8 x i1> splat (i1 true), i32 %evl)
186  ret <8 x float> %v
187}
188
189declare <16 x float> @llvm.vp.fdiv.v16f32(<16 x float>, <16 x float>, <16 x i1>, i32)
190
191define <16 x float> @vfrdiv_vf_v16f32(<16 x float> %va, float %b, <16 x i1> %m, i32 zeroext %evl) {
192; CHECK-LABEL: vfrdiv_vf_v16f32:
193; CHECK:       # %bb.0:
194; CHECK-NEXT:    vsetvli zero, a0, e32, m4, ta, ma
195; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
196; CHECK-NEXT:    ret
197  %elt.head = insertelement <16 x float> poison, float %b, i32 0
198  %vb = shufflevector <16 x float> %elt.head, <16 x float> poison, <16 x i32> zeroinitializer
199  %v = call <16 x float> @llvm.vp.fdiv.v16f32(<16 x float> %vb, <16 x float> %va, <16 x i1> %m, i32 %evl)
200  ret <16 x float> %v
201}
202
203define <16 x float> @vfrdiv_vf_v16f32_unmasked(<16 x float> %va, float %b, i32 zeroext %evl) {
204; CHECK-LABEL: vfrdiv_vf_v16f32_unmasked:
205; CHECK:       # %bb.0:
206; CHECK-NEXT:    vsetvli zero, a0, e32, m4, ta, ma
207; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
208; CHECK-NEXT:    ret
209  %elt.head = insertelement <16 x float> poison, float %b, i32 0
210  %vb = shufflevector <16 x float> %elt.head, <16 x float> poison, <16 x i32> zeroinitializer
211  %v = call <16 x float> @llvm.vp.fdiv.v16f32(<16 x float> %vb, <16 x float> %va, <16 x i1> splat (i1 true), i32 %evl)
212  ret <16 x float> %v
213}
214
215declare <2 x double> @llvm.vp.fdiv.v2f64(<2 x double>, <2 x double>, <2 x i1>, i32)
216
217define <2 x double> @vfrdiv_vf_v2f64(<2 x double> %va, double %b, <2 x i1> %m, i32 zeroext %evl) {
218; CHECK-LABEL: vfrdiv_vf_v2f64:
219; CHECK:       # %bb.0:
220; CHECK-NEXT:    vsetvli zero, a0, e64, m1, ta, ma
221; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
222; CHECK-NEXT:    ret
223  %elt.head = insertelement <2 x double> poison, double %b, i32 0
224  %vb = shufflevector <2 x double> %elt.head, <2 x double> poison, <2 x i32> zeroinitializer
225  %v = call <2 x double> @llvm.vp.fdiv.v2f64(<2 x double> %vb, <2 x double> %va, <2 x i1> %m, i32 %evl)
226  ret <2 x double> %v
227}
228
229define <2 x double> @vfrdiv_vf_v2f64_unmasked(<2 x double> %va, double %b, i32 zeroext %evl) {
230; CHECK-LABEL: vfrdiv_vf_v2f64_unmasked:
231; CHECK:       # %bb.0:
232; CHECK-NEXT:    vsetvli zero, a0, e64, m1, ta, ma
233; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
234; CHECK-NEXT:    ret
235  %elt.head = insertelement <2 x double> poison, double %b, i32 0
236  %vb = shufflevector <2 x double> %elt.head, <2 x double> poison, <2 x i32> zeroinitializer
237  %v = call <2 x double> @llvm.vp.fdiv.v2f64(<2 x double> %vb, <2 x double> %va, <2 x i1> splat (i1 true), i32 %evl)
238  ret <2 x double> %v
239}
240
241declare <4 x double> @llvm.vp.fdiv.v4f64(<4 x double>, <4 x double>, <4 x i1>, i32)
242
243define <4 x double> @vfrdiv_vf_v4f64(<4 x double> %va, double %b, <4 x i1> %m, i32 zeroext %evl) {
244; CHECK-LABEL: vfrdiv_vf_v4f64:
245; CHECK:       # %bb.0:
246; CHECK-NEXT:    vsetvli zero, a0, e64, m2, ta, ma
247; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
248; CHECK-NEXT:    ret
249  %elt.head = insertelement <4 x double> poison, double %b, i32 0
250  %vb = shufflevector <4 x double> %elt.head, <4 x double> poison, <4 x i32> zeroinitializer
251  %v = call <4 x double> @llvm.vp.fdiv.v4f64(<4 x double> %vb, <4 x double> %va, <4 x i1> %m, i32 %evl)
252  ret <4 x double> %v
253}
254
255define <4 x double> @vfrdiv_vf_v4f64_unmasked(<4 x double> %va, double %b, i32 zeroext %evl) {
256; CHECK-LABEL: vfrdiv_vf_v4f64_unmasked:
257; CHECK:       # %bb.0:
258; CHECK-NEXT:    vsetvli zero, a0, e64, m2, ta, ma
259; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
260; CHECK-NEXT:    ret
261  %elt.head = insertelement <4 x double> poison, double %b, i32 0
262  %vb = shufflevector <4 x double> %elt.head, <4 x double> poison, <4 x i32> zeroinitializer
263  %v = call <4 x double> @llvm.vp.fdiv.v4f64(<4 x double> %vb, <4 x double> %va, <4 x i1> splat (i1 true), i32 %evl)
264  ret <4 x double> %v
265}
266
267declare <8 x double> @llvm.vp.fdiv.v8f64(<8 x double>, <8 x double>, <8 x i1>, i32)
268
269define <8 x double> @vfrdiv_vf_v8f64(<8 x double> %va, double %b, <8 x i1> %m, i32 zeroext %evl) {
270; CHECK-LABEL: vfrdiv_vf_v8f64:
271; CHECK:       # %bb.0:
272; CHECK-NEXT:    vsetvli zero, a0, e64, m4, ta, ma
273; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
274; CHECK-NEXT:    ret
275  %elt.head = insertelement <8 x double> poison, double %b, i32 0
276  %vb = shufflevector <8 x double> %elt.head, <8 x double> poison, <8 x i32> zeroinitializer
277  %v = call <8 x double> @llvm.vp.fdiv.v8f64(<8 x double> %vb, <8 x double> %va, <8 x i1> %m, i32 %evl)
278  ret <8 x double> %v
279}
280
281define <8 x double> @vfrdiv_vf_v8f64_unmasked(<8 x double> %va, double %b, i32 zeroext %evl) {
282; CHECK-LABEL: vfrdiv_vf_v8f64_unmasked:
283; CHECK:       # %bb.0:
284; CHECK-NEXT:    vsetvli zero, a0, e64, m4, ta, ma
285; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
286; CHECK-NEXT:    ret
287  %elt.head = insertelement <8 x double> poison, double %b, i32 0
288  %vb = shufflevector <8 x double> %elt.head, <8 x double> poison, <8 x i32> zeroinitializer
289  %v = call <8 x double> @llvm.vp.fdiv.v8f64(<8 x double> %vb, <8 x double> %va, <8 x i1> splat (i1 true), i32 %evl)
290  ret <8 x double> %v
291}
292
293declare <16 x double> @llvm.vp.fdiv.v16f64(<16 x double>, <16 x double>, <16 x i1>, i32)
294
295define <16 x double> @vfrdiv_vf_v16f64(<16 x double> %va, double %b, <16 x i1> %m, i32 zeroext %evl) {
296; CHECK-LABEL: vfrdiv_vf_v16f64:
297; CHECK:       # %bb.0:
298; CHECK-NEXT:    vsetvli zero, a0, e64, m8, ta, ma
299; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0, v0.t
300; CHECK-NEXT:    ret
301  %elt.head = insertelement <16 x double> poison, double %b, i32 0
302  %vb = shufflevector <16 x double> %elt.head, <16 x double> poison, <16 x i32> zeroinitializer
303  %v = call <16 x double> @llvm.vp.fdiv.v16f64(<16 x double> %vb, <16 x double> %va, <16 x i1> %m, i32 %evl)
304  ret <16 x double> %v
305}
306
307define <16 x double> @vfrdiv_vf_v16f64_unmasked(<16 x double> %va, double %b, i32 zeroext %evl) {
308; CHECK-LABEL: vfrdiv_vf_v16f64_unmasked:
309; CHECK:       # %bb.0:
310; CHECK-NEXT:    vsetvli zero, a0, e64, m8, ta, ma
311; CHECK-NEXT:    vfrdiv.vf v8, v8, fa0
312; CHECK-NEXT:    ret
313  %elt.head = insertelement <16 x double> poison, double %b, i32 0
314  %vb = shufflevector <16 x double> %elt.head, <16 x double> poison, <16 x i32> zeroinitializer
315  %v = call <16 x double> @llvm.vp.fdiv.v16f64(<16 x double> %vb, <16 x double> %va, <16 x i1> splat (i1 true), i32 %evl)
316  ret <16 x double> %v
317}
318