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
7 ; This tests a mix of vfnmsac and vfnmsub by using different operand orders to
8 ; trigger commuting in TwoAddressInstructionPass.
10 declare <vscale x 1 x half> @llvm.fma.v1f16(<vscale x 1 x half>, <vscale x 1 x half>, <vscale x 1 x half>)
12 define <vscale x 1 x half> @vfnmsub_vv_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x half> %vc) {
13 ; CHECK-LABEL: vfnmsub_vv_nxv1f16:
15 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
16 ; CHECK-NEXT: vfnmsub.vv v8, v9, v10
18 %neg = fneg <vscale x 1 x half> %va
19 %vd = call <vscale x 1 x half> @llvm.fma.v1f16(<vscale x 1 x half> %neg, <vscale x 1 x half> %vb, <vscale x 1 x half> %vc)
20 ret <vscale x 1 x half> %vd
23 define <vscale x 1 x half> @vfnmsub_vf_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, half %c) {
24 ; CHECK-LABEL: vfnmsub_vf_nxv1f16:
26 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
27 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v9
29 %head = insertelement <vscale x 1 x half> poison, half %c, i32 0
30 %splat = shufflevector <vscale x 1 x half> %head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
31 %neg = fneg <vscale x 1 x half> %va
32 %vd = call <vscale x 1 x half> @llvm.fma.v1f16(<vscale x 1 x half> %neg, <vscale x 1 x half> %splat, <vscale x 1 x half> %vb)
33 ret <vscale x 1 x half> %vd
36 declare <vscale x 2 x half> @llvm.fma.v2f16(<vscale x 2 x half>, <vscale x 2 x half>, <vscale x 2 x half>)
38 define <vscale x 2 x half> @vfnmsub_vv_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, <vscale x 2 x half> %vc) {
39 ; CHECK-LABEL: vfnmsub_vv_nxv2f16:
41 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
42 ; CHECK-NEXT: vfnmsub.vv v8, v10, v9
44 %neg = fneg <vscale x 2 x half> %va
45 %vd = call <vscale x 2 x half> @llvm.fma.v2f16(<vscale x 2 x half> %neg, <vscale x 2 x half> %vc, <vscale x 2 x half> %vb)
46 ret <vscale x 2 x half> %vd
49 define <vscale x 2 x half> @vfnmsub_vf_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, half %c) {
50 ; CHECK-LABEL: vfnmsub_vf_nxv2f16:
52 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
53 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v9
55 %head = insertelement <vscale x 2 x half> poison, half %c, i32 0
56 %splat = shufflevector <vscale x 2 x half> %head, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
57 %neg = fneg <vscale x 2 x half> %va
58 %vd = call <vscale x 2 x half> @llvm.fma.v2f16(<vscale x 2 x half> %splat, <vscale x 2 x half> %neg, <vscale x 2 x half> %vb)
59 ret <vscale x 2 x half> %vd
62 declare <vscale x 4 x half> @llvm.fma.v4f16(<vscale x 4 x half>, <vscale x 4 x half>, <vscale x 4 x half>)
64 define <vscale x 4 x half> @vfnmsub_vv_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, <vscale x 4 x half> %vc) {
65 ; CHECK-LABEL: vfnmsub_vv_nxv4f16:
67 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
68 ; CHECK-NEXT: vfnmsub.vv v8, v9, v10
70 %neg = fneg <vscale x 4 x half> %vb
71 %vd = call <vscale x 4 x half> @llvm.fma.v4f16(<vscale x 4 x half> %neg, <vscale x 4 x half> %va, <vscale x 4 x half> %vc)
72 ret <vscale x 4 x half> %vd
75 define <vscale x 4 x half> @vfnmsub_vf_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, half %c) {
76 ; CHECK-LABEL: vfnmsub_vf_nxv4f16:
78 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
79 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v9
81 %head = insertelement <vscale x 4 x half> poison, half %c, i32 0
82 %splat = shufflevector <vscale x 4 x half> %head, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
83 %neg = fneg <vscale x 4 x half> %splat
84 %vd = call <vscale x 4 x half> @llvm.fma.v4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %neg, <vscale x 4 x half> %vb)
85 ret <vscale x 4 x half> %vd
88 declare <vscale x 8 x half> @llvm.fma.v8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>)
90 define <vscale x 8 x half> @vfnmsub_vv_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, <vscale x 8 x half> %vc) {
91 ; CHECK-LABEL: vfnmsub_vv_nxv8f16:
93 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
94 ; CHECK-NEXT: vfnmsac.vv v8, v12, v10
96 %neg = fneg <vscale x 8 x half> %vb
97 %vd = call <vscale x 8 x half> @llvm.fma.v8f16(<vscale x 8 x half> %neg, <vscale x 8 x half> %vc, <vscale x 8 x half> %va)
98 ret <vscale x 8 x half> %vd
101 define <vscale x 8 x half> @vfnmsub_vf_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, half %c) {
102 ; CHECK-LABEL: vfnmsub_vf_nxv8f16:
104 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
105 ; CHECK-NEXT: vfnmsac.vf v8, fa0, v10
107 %head = insertelement <vscale x 8 x half> poison, half %c, i32 0
108 %splat = shufflevector <vscale x 8 x half> %head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
109 %neg = fneg <vscale x 8 x half> %splat
110 %vd = call <vscale x 8 x half> @llvm.fma.v8f16(<vscale x 8 x half> %vb, <vscale x 8 x half> %neg, <vscale x 8 x half> %va)
111 ret <vscale x 8 x half> %vd
114 declare <vscale x 16 x half> @llvm.fma.v16f16(<vscale x 16 x half>, <vscale x 16 x half>, <vscale x 16 x half>)
116 define <vscale x 16 x half> @vfnmsub_vv_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, <vscale x 16 x half> %vc) {
117 ; CHECK-LABEL: vfnmsub_vv_nxv16f16:
119 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
120 ; CHECK-NEXT: vfnmsub.vv v8, v16, v12
122 %neg = fneg <vscale x 16 x half> %vc
123 %vd = call <vscale x 16 x half> @llvm.fma.v16f16(<vscale x 16 x half> %neg, <vscale x 16 x half> %va, <vscale x 16 x half> %vb)
124 ret <vscale x 16 x half> %vd
127 define <vscale x 16 x half> @vfnmsub_vf_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, half %c) {
128 ; CHECK-LABEL: vfnmsub_vf_nxv16f16:
130 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
131 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v12
133 %head = insertelement <vscale x 16 x half> poison, half %c, i32 0
134 %splat = shufflevector <vscale x 16 x half> %head, <vscale x 16 x half> poison, <vscale x 16 x i32> zeroinitializer
135 %neg = fneg <vscale x 16 x half> %splat
136 %vd = call <vscale x 16 x half> @llvm.fma.v16f16(<vscale x 16 x half> %neg, <vscale x 16 x half> %va, <vscale x 16 x half> %vb)
137 ret <vscale x 16 x half> %vd
140 declare <vscale x 32 x half> @llvm.fma.v32f16(<vscale x 32 x half>, <vscale x 32 x half>, <vscale x 32 x half>)
142 define <vscale x 32 x half> @vfnmsub_vv_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, <vscale x 32 x half> %vc) {
143 ; CHECK-LABEL: vfnmsub_vv_nxv32f16:
145 ; CHECK-NEXT: vl8re16.v v24, (a0)
146 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
147 ; CHECK-NEXT: vfnmsub.vv v8, v24, v16
149 %neg = fneg <vscale x 32 x half> %vc
150 %vd = call <vscale x 32 x half> @llvm.fma.v32f16(<vscale x 32 x half> %neg, <vscale x 32 x half> %va, <vscale x 32 x half> %vb)
151 ret <vscale x 32 x half> %vd
154 define <vscale x 32 x half> @vfnmsub_vf_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, half %c) {
155 ; CHECK-LABEL: vfnmsub_vf_nxv32f16:
157 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
158 ; CHECK-NEXT: vfnmsac.vf v8, fa0, v16
160 %head = insertelement <vscale x 32 x half> poison, half %c, i32 0
161 %splat = shufflevector <vscale x 32 x half> %head, <vscale x 32 x half> poison, <vscale x 32 x i32> zeroinitializer
162 %neg = fneg <vscale x 32 x half> %splat
163 %vd = call <vscale x 32 x half> @llvm.fma.v32f16(<vscale x 32 x half> %neg, <vscale x 32 x half> %vb, <vscale x 32 x half> %va)
164 ret <vscale x 32 x half> %vd
167 declare <vscale x 1 x float> @llvm.fma.v1f32(<vscale x 1 x float>, <vscale x 1 x float>, <vscale x 1 x float>)
169 define <vscale x 1 x float> @vfnmsub_vv_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x float> %vc) {
170 ; CHECK-LABEL: vfnmsub_vv_nxv1f32:
172 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
173 ; CHECK-NEXT: vfnmsub.vv v8, v9, v10
175 %neg = fneg <vscale x 1 x float> %vb
176 %vd = call <vscale x 1 x float> @llvm.fma.v1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %neg, <vscale x 1 x float> %vc)
177 ret <vscale x 1 x float> %vd
180 define <vscale x 1 x float> @vfnmsub_vf_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, float %c) {
181 ; CHECK-LABEL: vfnmsub_vf_nxv1f32:
183 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
184 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v9
186 %head = insertelement <vscale x 1 x float> poison, float %c, i32 0
187 %splat = shufflevector <vscale x 1 x float> %head, <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer
188 %neg = fneg <vscale x 1 x float> %va
189 %vd = call <vscale x 1 x float> @llvm.fma.v1f32(<vscale x 1 x float> %neg, <vscale x 1 x float> %splat, <vscale x 1 x float> %vb)
190 ret <vscale x 1 x float> %vd
193 declare <vscale x 2 x float> @llvm.fma.v2f32(<vscale x 2 x float>, <vscale x 2 x float>, <vscale x 2 x float>)
195 define <vscale x 2 x float> @vfnmsub_vv_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, <vscale x 2 x float> %vc) {
196 ; CHECK-LABEL: vfnmsub_vv_nxv2f32:
198 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
199 ; CHECK-NEXT: vfnmsub.vv v8, v10, v9
201 %neg = fneg <vscale x 2 x float> %vc
202 %vd = call <vscale x 2 x float> @llvm.fma.v2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %neg, <vscale x 2 x float> %vb)
203 ret <vscale x 2 x float> %vd
206 define <vscale x 2 x float> @vfnmsub_vf_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, float %c) {
207 ; CHECK-LABEL: vfnmsub_vf_nxv2f32:
209 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
210 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v9
212 %head = insertelement <vscale x 2 x float> poison, float %c, i32 0
213 %splat = shufflevector <vscale x 2 x float> %head, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
214 %neg = fneg <vscale x 2 x float> %va
215 %vd = call <vscale x 2 x float> @llvm.fma.v2f32(<vscale x 2 x float> %splat, <vscale x 2 x float> %neg, <vscale x 2 x float> %vb)
216 ret <vscale x 2 x float> %vd
219 declare <vscale x 4 x float> @llvm.fma.v4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)
221 define <vscale x 4 x float> @vfnmsub_vv_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, <vscale x 4 x float> %vc) {
222 ; CHECK-LABEL: vfnmsub_vv_nxv4f32:
224 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
225 ; CHECK-NEXT: vfnmsub.vv v8, v10, v12
227 %neg = fneg <vscale x 4 x float> %va
228 %vd = call <vscale x 4 x float> @llvm.fma.v4f32(<vscale x 4 x float> %vb, <vscale x 4 x float> %neg, <vscale x 4 x float> %vc)
229 ret <vscale x 4 x float> %vd
232 define <vscale x 4 x float> @vfnmsub_vf_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, float %c) {
233 ; CHECK-LABEL: vfnmsub_vf_nxv4f32:
235 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
236 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v10
238 %head = insertelement <vscale x 4 x float> poison, float %c, i32 0
239 %splat = shufflevector <vscale x 4 x float> %head, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
240 %neg = fneg <vscale x 4 x float> %splat
241 %vd = call <vscale x 4 x float> @llvm.fma.v4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %neg, <vscale x 4 x float> %vb)
242 ret <vscale x 4 x float> %vd
245 declare <vscale x 8 x float> @llvm.fma.v8f32(<vscale x 8 x float>, <vscale x 8 x float>, <vscale x 8 x float>)
247 define <vscale x 8 x float> @vfnmsub_vv_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, <vscale x 8 x float> %vc) {
248 ; CHECK-LABEL: vfnmsub_vv_nxv8f32:
250 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
251 ; CHECK-NEXT: vfnmsac.vv v8, v16, v12
253 %neg = fneg <vscale x 8 x float> %vc
254 %vd = call <vscale x 8 x float> @llvm.fma.v8f32(<vscale x 8 x float> %vb, <vscale x 8 x float> %neg, <vscale x 8 x float> %va)
255 ret <vscale x 8 x float> %vd
258 define <vscale x 8 x float> @vfnmsub_vf_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, float %c) {
259 ; CHECK-LABEL: vfnmsub_vf_nxv8f32:
261 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
262 ; CHECK-NEXT: vfnmsac.vf v8, fa0, v12
264 %head = insertelement <vscale x 8 x float> poison, float %c, i32 0
265 %splat = shufflevector <vscale x 8 x float> %head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
266 %neg = fneg <vscale x 8 x float> %splat
267 %vd = call <vscale x 8 x float> @llvm.fma.v8f32(<vscale x 8 x float> %vb, <vscale x 8 x float> %neg, <vscale x 8 x float> %va)
268 ret <vscale x 8 x float> %vd
271 declare <vscale x 16 x float> @llvm.fma.v16f32(<vscale x 16 x float>, <vscale x 16 x float>, <vscale x 16 x float>)
273 define <vscale x 16 x float> @vfnmsub_vv_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, <vscale x 16 x float> %vc) {
274 ; CHECK-LABEL: vfnmsub_vv_nxv16f32:
276 ; CHECK-NEXT: vl8re32.v v24, (a0)
277 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
278 ; CHECK-NEXT: vfnmsub.vv v8, v24, v16
280 %neg = fneg <vscale x 16 x float> %va
281 %vd = call <vscale x 16 x float> @llvm.fma.v16f32(<vscale x 16 x float> %vc, <vscale x 16 x float> %neg, <vscale x 16 x float> %vb)
282 ret <vscale x 16 x float> %vd
285 define <vscale x 16 x float> @vfnmsub_vf_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, float %c) {
286 ; CHECK-LABEL: vfnmsub_vf_nxv16f32:
288 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
289 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v16
291 %head = insertelement <vscale x 16 x float> poison, float %c, i32 0
292 %splat = shufflevector <vscale x 16 x float> %head, <vscale x 16 x float> poison, <vscale x 16 x i32> zeroinitializer
293 %neg = fneg <vscale x 16 x float> %splat
294 %vd = call <vscale x 16 x float> @llvm.fma.v16f32(<vscale x 16 x float> %neg, <vscale x 16 x float> %va, <vscale x 16 x float> %vb)
295 ret <vscale x 16 x float> %vd
298 declare <vscale x 1 x double> @llvm.fma.v1f64(<vscale x 1 x double>, <vscale x 1 x double>, <vscale x 1 x double>)
300 define <vscale x 1 x double> @vfnmsub_vv_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x double> %vc) {
301 ; CHECK-LABEL: vfnmsub_vv_nxv1f64:
303 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
304 ; CHECK-NEXT: vfnmsac.vv v8, v10, v9
306 %neg = fneg <vscale x 1 x double> %vb
307 %vd = call <vscale x 1 x double> @llvm.fma.v1f64(<vscale x 1 x double> %vc, <vscale x 1 x double> %neg, <vscale x 1 x double> %va)
308 ret <vscale x 1 x double> %vd
311 define <vscale x 1 x double> @vfnmsub_vf_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, double %c) {
312 ; CHECK-LABEL: vfnmsub_vf_nxv1f64:
314 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
315 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v9
317 %head = insertelement <vscale x 1 x double> poison, double %c, i32 0
318 %splat = shufflevector <vscale x 1 x double> %head, <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer
319 %neg = fneg <vscale x 1 x double> %va
320 %vd = call <vscale x 1 x double> @llvm.fma.v1f64(<vscale x 1 x double> %neg, <vscale x 1 x double> %splat, <vscale x 1 x double> %vb)
321 ret <vscale x 1 x double> %vd
324 declare <vscale x 2 x double> @llvm.fma.v2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>)
326 define <vscale x 2 x double> @vfnmsub_vv_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, <vscale x 2 x double> %vc) {
327 ; CHECK-LABEL: vfnmsub_vv_nxv2f64:
329 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
330 ; CHECK-NEXT: vfnmsub.vv v8, v12, v10
332 %neg = fneg <vscale x 2 x double> %va
333 %vd = call <vscale x 2 x double> @llvm.fma.v2f64(<vscale x 2 x double> %neg, <vscale x 2 x double> %vc, <vscale x 2 x double> %vb)
334 ret <vscale x 2 x double> %vd
337 define <vscale x 2 x double> @vfnmsub_vf_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, double %c) {
338 ; CHECK-LABEL: vfnmsub_vf_nxv2f64:
340 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
341 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v10
343 %head = insertelement <vscale x 2 x double> poison, double %c, i32 0
344 %splat = shufflevector <vscale x 2 x double> %head, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
345 %neg = fneg <vscale x 2 x double> %va
346 %vd = call <vscale x 2 x double> @llvm.fma.v2f64(<vscale x 2 x double> %splat, <vscale x 2 x double> %neg, <vscale x 2 x double> %vb)
347 ret <vscale x 2 x double> %vd
350 declare <vscale x 4 x double> @llvm.fma.v4f64(<vscale x 4 x double>, <vscale x 4 x double>, <vscale x 4 x double>)
352 define <vscale x 4 x double> @vfnmsub_vv_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, <vscale x 4 x double> %vc) {
353 ; CHECK-LABEL: vfnmsub_vv_nxv4f64:
355 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
356 ; CHECK-NEXT: vfnmsub.vv v8, v12, v16
358 %neg = fneg <vscale x 4 x double> %vb
359 %vd = call <vscale x 4 x double> @llvm.fma.v4f64(<vscale x 4 x double> %neg, <vscale x 4 x double> %va, <vscale x 4 x double> %vc)
360 ret <vscale x 4 x double> %vd
363 define <vscale x 4 x double> @vfnmsub_vf_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, double %c) {
364 ; CHECK-LABEL: vfnmsub_vf_nxv4f64:
366 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
367 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v12
369 %head = insertelement <vscale x 4 x double> poison, double %c, i32 0
370 %splat = shufflevector <vscale x 4 x double> %head, <vscale x 4 x double> poison, <vscale x 4 x i32> zeroinitializer
371 %neg = fneg <vscale x 4 x double> %splat
372 %vd = call <vscale x 4 x double> @llvm.fma.v4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %neg, <vscale x 4 x double> %vb)
373 ret <vscale x 4 x double> %vd
376 declare <vscale x 8 x double> @llvm.fma.v8f64(<vscale x 8 x double>, <vscale x 8 x double>, <vscale x 8 x double>)
378 define <vscale x 8 x double> @vfnmsub_vv_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, <vscale x 8 x double> %vc) {
379 ; CHECK-LABEL: vfnmsub_vv_nxv8f64:
381 ; CHECK-NEXT: vl8re64.v v24, (a0)
382 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
383 ; CHECK-NEXT: vfnmsac.vv v8, v16, v24
385 %neg = fneg <vscale x 8 x double> %vb
386 %vd = call <vscale x 8 x double> @llvm.fma.v8f64(<vscale x 8 x double> %neg, <vscale x 8 x double> %vc, <vscale x 8 x double> %va)
387 ret <vscale x 8 x double> %vd
390 define <vscale x 8 x double> @vfnmsub_vf_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, double %c) {
391 ; CHECK-LABEL: vfnmsub_vf_nxv8f64:
393 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
394 ; CHECK-NEXT: vfnmsac.vf v8, fa0, v16
396 %head = insertelement <vscale x 8 x double> poison, double %c, i32 0
397 %splat = shufflevector <vscale x 8 x double> %head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
398 %neg = fneg <vscale x 8 x double> %splat
399 %vd = call <vscale x 8 x double> @llvm.fma.v8f64(<vscale x 8 x double> %vb, <vscale x 8 x double> %neg, <vscale x 8 x double> %va)
400 ret <vscale x 8 x double> %vd