1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch64 --mattr=+lasx --fp-contract=fast < %s \
3 ; RUN: | FileCheck %s --check-prefix=CONTRACT-FAST
4 ; RUN: llc --mtriple=loongarch64 --mattr=+lasx --fp-contract=on < %s \
5 ; RUN: | FileCheck %s --check-prefix=CONTRACT-ON
6 ; RUN: llc --mtriple=loongarch64 --mattr=+lasx --fp-contract=off < %s \
7 ; RUN: | FileCheck %s --check-prefix=CONTRACT-OFF
9 define void @xvfmadd_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
10 ; CONTRACT-FAST-LABEL: xvfmadd_s:
11 ; CONTRACT-FAST: # %bb.0: # %entry
12 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
13 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
14 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
15 ; CONTRACT-FAST-NEXT: xvfmadd.s $xr0, $xr0, $xr1, $xr2
16 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
17 ; CONTRACT-FAST-NEXT: ret
19 ; CONTRACT-ON-LABEL: xvfmadd_s:
20 ; CONTRACT-ON: # %bb.0: # %entry
21 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
22 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
23 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
24 ; CONTRACT-ON-NEXT: xvfmul.s $xr0, $xr0, $xr1
25 ; CONTRACT-ON-NEXT: xvfadd.s $xr0, $xr0, $xr2
26 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
27 ; CONTRACT-ON-NEXT: ret
29 ; CONTRACT-OFF-LABEL: xvfmadd_s:
30 ; CONTRACT-OFF: # %bb.0: # %entry
31 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
32 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
33 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
34 ; CONTRACT-OFF-NEXT: xvfmul.s $xr0, $xr0, $xr1
35 ; CONTRACT-OFF-NEXT: xvfadd.s $xr0, $xr0, $xr2
36 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
37 ; CONTRACT-OFF-NEXT: ret
39 %v0 = load <8 x float>, ptr %a0
40 %v1 = load <8 x float>, ptr %a1
41 %v2 = load <8 x float>, ptr %a2
42 %mul = fmul<8 x float> %v0, %v1
43 %add = fadd<8 x float> %mul, %v2
44 store <8 x float> %add, ptr %res
48 define void @xvfmsub_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
49 ; CONTRACT-FAST-LABEL: xvfmsub_s:
50 ; CONTRACT-FAST: # %bb.0: # %entry
51 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
52 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
53 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
54 ; CONTRACT-FAST-NEXT: xvfmsub.s $xr0, $xr0, $xr1, $xr2
55 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
56 ; CONTRACT-FAST-NEXT: ret
58 ; CONTRACT-ON-LABEL: xvfmsub_s:
59 ; CONTRACT-ON: # %bb.0: # %entry
60 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
61 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
62 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
63 ; CONTRACT-ON-NEXT: xvfmul.s $xr0, $xr0, $xr1
64 ; CONTRACT-ON-NEXT: xvfsub.s $xr0, $xr0, $xr2
65 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
66 ; CONTRACT-ON-NEXT: ret
68 ; CONTRACT-OFF-LABEL: xvfmsub_s:
69 ; CONTRACT-OFF: # %bb.0: # %entry
70 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
71 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
72 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
73 ; CONTRACT-OFF-NEXT: xvfmul.s $xr0, $xr0, $xr1
74 ; CONTRACT-OFF-NEXT: xvfsub.s $xr0, $xr0, $xr2
75 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
76 ; CONTRACT-OFF-NEXT: ret
78 %v0 = load <8 x float>, ptr %a0
79 %v1 = load <8 x float>, ptr %a1
80 %v2 = load <8 x float>, ptr %a2
81 %mul = fmul<8 x float> %v0, %v1
82 %sub = fsub<8 x float> %mul, %v2
83 store <8 x float> %sub, ptr %res
87 define void @xvfnmadd_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
88 ; CONTRACT-FAST-LABEL: xvfnmadd_s:
89 ; CONTRACT-FAST: # %bb.0: # %entry
90 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
91 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
92 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
93 ; CONTRACT-FAST-NEXT: xvfnmadd.s $xr0, $xr0, $xr1, $xr2
94 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
95 ; CONTRACT-FAST-NEXT: ret
97 ; CONTRACT-ON-LABEL: xvfnmadd_s:
98 ; CONTRACT-ON: # %bb.0: # %entry
99 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
100 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
101 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
102 ; CONTRACT-ON-NEXT: xvfmul.s $xr0, $xr0, $xr1
103 ; CONTRACT-ON-NEXT: xvfadd.s $xr0, $xr0, $xr2
104 ; CONTRACT-ON-NEXT: xvbitrevi.w $xr0, $xr0, 31
105 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
106 ; CONTRACT-ON-NEXT: ret
108 ; CONTRACT-OFF-LABEL: xvfnmadd_s:
109 ; CONTRACT-OFF: # %bb.0: # %entry
110 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
111 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
112 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
113 ; CONTRACT-OFF-NEXT: xvfmul.s $xr0, $xr0, $xr1
114 ; CONTRACT-OFF-NEXT: xvfadd.s $xr0, $xr0, $xr2
115 ; CONTRACT-OFF-NEXT: xvbitrevi.w $xr0, $xr0, 31
116 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
117 ; CONTRACT-OFF-NEXT: ret
119 %v0 = load <8 x float>, ptr %a0
120 %v1 = load <8 x float>, ptr %a1
121 %v2 = load <8 x float>, ptr %a2
122 %mul = fmul<8 x float> %v0, %v1
123 %add = fadd<8 x float> %mul, %v2
124 %negadd = fneg<8 x float> %add
125 store <8 x float> %negadd, ptr %res
129 define void @xvfnmadd_s_nsz(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
130 ; CONTRACT-FAST-LABEL: xvfnmadd_s_nsz:
131 ; CONTRACT-FAST: # %bb.0: # %entry
132 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
133 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
134 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
135 ; CONTRACT-FAST-NEXT: xvfnmadd.s $xr0, $xr0, $xr1, $xr2
136 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
137 ; CONTRACT-FAST-NEXT: ret
139 ; CONTRACT-ON-LABEL: xvfnmadd_s_nsz:
140 ; CONTRACT-ON: # %bb.0: # %entry
141 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
142 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
143 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
144 ; CONTRACT-ON-NEXT: xvbitrevi.w $xr0, $xr0, 31
145 ; CONTRACT-ON-NEXT: xvfmul.s $xr0, $xr0, $xr1
146 ; CONTRACT-ON-NEXT: xvfsub.s $xr0, $xr0, $xr2
147 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
148 ; CONTRACT-ON-NEXT: ret
150 ; CONTRACT-OFF-LABEL: xvfnmadd_s_nsz:
151 ; CONTRACT-OFF: # %bb.0: # %entry
152 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
153 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
154 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
155 ; CONTRACT-OFF-NEXT: xvbitrevi.w $xr0, $xr0, 31
156 ; CONTRACT-OFF-NEXT: xvfmul.s $xr0, $xr0, $xr1
157 ; CONTRACT-OFF-NEXT: xvfsub.s $xr0, $xr0, $xr2
158 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
159 ; CONTRACT-OFF-NEXT: ret
161 %v0 = load <8 x float>, ptr %a0
162 %v1 = load <8 x float>, ptr %a1
163 %v2 = load <8 x float>, ptr %a2
164 %negv0 = fneg nsz<8 x float> %v0
165 %negv2 = fneg nsz<8 x float> %v2
166 %mul = fmul nsz<8 x float> %negv0, %v1
167 %add = fadd nsz<8 x float> %mul, %negv2
168 store <8 x float> %add, ptr %res
172 ;; Check that fnmadd.s is not emitted.
173 define void @not_xvfnmadd_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
174 ; CONTRACT-FAST-LABEL: not_xvfnmadd_s:
175 ; CONTRACT-FAST: # %bb.0: # %entry
176 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
177 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
178 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
179 ; CONTRACT-FAST-NEXT: xvbitrevi.w $xr0, $xr0, 31
180 ; CONTRACT-FAST-NEXT: xvfmsub.s $xr0, $xr0, $xr1, $xr2
181 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
182 ; CONTRACT-FAST-NEXT: ret
184 ; CONTRACT-ON-LABEL: not_xvfnmadd_s:
185 ; CONTRACT-ON: # %bb.0: # %entry
186 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
187 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
188 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
189 ; CONTRACT-ON-NEXT: xvbitrevi.w $xr0, $xr0, 31
190 ; CONTRACT-ON-NEXT: xvfmul.s $xr0, $xr0, $xr1
191 ; CONTRACT-ON-NEXT: xvfsub.s $xr0, $xr0, $xr2
192 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
193 ; CONTRACT-ON-NEXT: ret
195 ; CONTRACT-OFF-LABEL: not_xvfnmadd_s:
196 ; CONTRACT-OFF: # %bb.0: # %entry
197 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
198 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
199 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
200 ; CONTRACT-OFF-NEXT: xvbitrevi.w $xr0, $xr0, 31
201 ; CONTRACT-OFF-NEXT: xvfmul.s $xr0, $xr0, $xr1
202 ; CONTRACT-OFF-NEXT: xvfsub.s $xr0, $xr0, $xr2
203 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
204 ; CONTRACT-OFF-NEXT: ret
206 %v0 = load <8 x float>, ptr %a0
207 %v1 = load <8 x float>, ptr %a1
208 %v2 = load <8 x float>, ptr %a2
209 %negv0 = fneg<8 x float> %v0
210 %negv2 = fneg<8 x float> %v2
211 %mul = fmul<8 x float> %negv0, %v1
212 %add = fadd<8 x float> %mul, %negv2
213 store <8 x float> %add, ptr %res
217 define void @xvfnmsub_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
218 ; CONTRACT-FAST-LABEL: xvfnmsub_s:
219 ; CONTRACT-FAST: # %bb.0: # %entry
220 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
221 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
222 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
223 ; CONTRACT-FAST-NEXT: xvfnmsub.s $xr0, $xr0, $xr1, $xr2
224 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
225 ; CONTRACT-FAST-NEXT: ret
227 ; CONTRACT-ON-LABEL: xvfnmsub_s:
228 ; CONTRACT-ON: # %bb.0: # %entry
229 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
230 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
231 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
232 ; CONTRACT-ON-NEXT: xvfmul.s $xr0, $xr0, $xr1
233 ; CONTRACT-ON-NEXT: xvfsub.s $xr0, $xr0, $xr2
234 ; CONTRACT-ON-NEXT: xvbitrevi.w $xr0, $xr0, 31
235 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
236 ; CONTRACT-ON-NEXT: ret
238 ; CONTRACT-OFF-LABEL: xvfnmsub_s:
239 ; CONTRACT-OFF: # %bb.0: # %entry
240 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
241 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
242 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
243 ; CONTRACT-OFF-NEXT: xvfmul.s $xr0, $xr0, $xr1
244 ; CONTRACT-OFF-NEXT: xvfsub.s $xr0, $xr0, $xr2
245 ; CONTRACT-OFF-NEXT: xvbitrevi.w $xr0, $xr0, 31
246 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
247 ; CONTRACT-OFF-NEXT: ret
249 %v0 = load <8 x float>, ptr %a0
250 %v1 = load <8 x float>, ptr %a1
251 %v2 = load <8 x float>, ptr %a2
252 %negv2 = fneg<8 x float> %v2
253 %mul = fmul<8 x float> %v0, %v1
254 %add = fadd<8 x float> %mul, %negv2
255 %neg = fneg<8 x float> %add
256 store <8 x float> %neg, ptr %res
260 define void @xvfnmsub_s_nsz(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
261 ; CONTRACT-FAST-LABEL: xvfnmsub_s_nsz:
262 ; CONTRACT-FAST: # %bb.0: # %entry
263 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
264 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
265 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
266 ; CONTRACT-FAST-NEXT: xvfnmsub.s $xr0, $xr0, $xr1, $xr2
267 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
268 ; CONTRACT-FAST-NEXT: ret
270 ; CONTRACT-ON-LABEL: xvfnmsub_s_nsz:
271 ; CONTRACT-ON: # %bb.0: # %entry
272 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
273 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
274 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
275 ; CONTRACT-ON-NEXT: xvfmul.s $xr0, $xr0, $xr1
276 ; CONTRACT-ON-NEXT: xvfsub.s $xr0, $xr2, $xr0
277 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
278 ; CONTRACT-ON-NEXT: ret
280 ; CONTRACT-OFF-LABEL: xvfnmsub_s_nsz:
281 ; CONTRACT-OFF: # %bb.0: # %entry
282 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
283 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
284 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
285 ; CONTRACT-OFF-NEXT: xvfmul.s $xr0, $xr0, $xr1
286 ; CONTRACT-OFF-NEXT: xvfsub.s $xr0, $xr2, $xr0
287 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
288 ; CONTRACT-OFF-NEXT: ret
290 %v0 = load <8 x float>, ptr %a0
291 %v1 = load <8 x float>, ptr %a1
292 %v2 = load <8 x float>, ptr %a2
293 %negv0 = fneg nsz<8 x float> %v0
294 %mul = fmul nsz<8 x float> %negv0, %v1
295 %add = fadd nsz<8 x float> %mul, %v2
296 store <8 x float> %add, ptr %res
300 ;; Check that fnmsub.s is not emitted.
301 define void @not_xvfnmsub_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
302 ; CONTRACT-FAST-LABEL: not_xvfnmsub_s:
303 ; CONTRACT-FAST: # %bb.0: # %entry
304 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
305 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
306 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
307 ; CONTRACT-FAST-NEXT: xvbitrevi.w $xr0, $xr0, 31
308 ; CONTRACT-FAST-NEXT: xvfmadd.s $xr0, $xr0, $xr1, $xr2
309 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
310 ; CONTRACT-FAST-NEXT: ret
312 ; CONTRACT-ON-LABEL: not_xvfnmsub_s:
313 ; CONTRACT-ON: # %bb.0: # %entry
314 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
315 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
316 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
317 ; CONTRACT-ON-NEXT: xvfmul.s $xr0, $xr0, $xr1
318 ; CONTRACT-ON-NEXT: xvfsub.s $xr0, $xr2, $xr0
319 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
320 ; CONTRACT-ON-NEXT: ret
322 ; CONTRACT-OFF-LABEL: not_xvfnmsub_s:
323 ; CONTRACT-OFF: # %bb.0: # %entry
324 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
325 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
326 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
327 ; CONTRACT-OFF-NEXT: xvfmul.s $xr0, $xr0, $xr1
328 ; CONTRACT-OFF-NEXT: xvfsub.s $xr0, $xr2, $xr0
329 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
330 ; CONTRACT-OFF-NEXT: ret
332 %v0 = load <8 x float>, ptr %a0
333 %v1 = load <8 x float>, ptr %a1
334 %v2 = load <8 x float>, ptr %a2
335 %negv0 = fneg<8 x float> %v0
336 %mul = fmul<8 x float> %negv0, %v1
337 %add = fadd<8 x float> %mul, %v2
338 store <8 x float> %add, ptr %res
342 define void @contract_xvfmadd_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
343 ; CONTRACT-FAST-LABEL: contract_xvfmadd_s:
344 ; CONTRACT-FAST: # %bb.0: # %entry
345 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
346 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
347 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
348 ; CONTRACT-FAST-NEXT: xvfmadd.s $xr0, $xr0, $xr1, $xr2
349 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
350 ; CONTRACT-FAST-NEXT: ret
352 ; CONTRACT-ON-LABEL: contract_xvfmadd_s:
353 ; CONTRACT-ON: # %bb.0: # %entry
354 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
355 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
356 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
357 ; CONTRACT-ON-NEXT: xvfmadd.s $xr0, $xr0, $xr1, $xr2
358 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
359 ; CONTRACT-ON-NEXT: ret
361 ; CONTRACT-OFF-LABEL: contract_xvfmadd_s:
362 ; CONTRACT-OFF: # %bb.0: # %entry
363 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
364 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
365 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
366 ; CONTRACT-OFF-NEXT: xvfmadd.s $xr0, $xr0, $xr1, $xr2
367 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
368 ; CONTRACT-OFF-NEXT: ret
370 %v0 = load <8 x float>, ptr %a0
371 %v1 = load <8 x float>, ptr %a1
372 %v2 = load <8 x float>, ptr %a2
373 %mul = fmul contract <8 x float> %v0, %v1
374 %add = fadd contract <8 x float> %mul, %v2
375 store <8 x float> %add, ptr %res
379 define void @contract_xvfmsub_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
380 ; CONTRACT-FAST-LABEL: contract_xvfmsub_s:
381 ; CONTRACT-FAST: # %bb.0: # %entry
382 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
383 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
384 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
385 ; CONTRACT-FAST-NEXT: xvfmsub.s $xr0, $xr0, $xr1, $xr2
386 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
387 ; CONTRACT-FAST-NEXT: ret
389 ; CONTRACT-ON-LABEL: contract_xvfmsub_s:
390 ; CONTRACT-ON: # %bb.0: # %entry
391 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
392 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
393 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
394 ; CONTRACT-ON-NEXT: xvfmsub.s $xr0, $xr0, $xr1, $xr2
395 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
396 ; CONTRACT-ON-NEXT: ret
398 ; CONTRACT-OFF-LABEL: contract_xvfmsub_s:
399 ; CONTRACT-OFF: # %bb.0: # %entry
400 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
401 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
402 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
403 ; CONTRACT-OFF-NEXT: xvfmsub.s $xr0, $xr0, $xr1, $xr2
404 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
405 ; CONTRACT-OFF-NEXT: ret
407 %v0 = load <8 x float>, ptr %a0
408 %v1 = load <8 x float>, ptr %a1
409 %v2 = load <8 x float>, ptr %a2
410 %mul = fmul contract <8 x float> %v0, %v1
411 %sub = fsub contract <8 x float> %mul, %v2
412 store <8 x float> %sub, ptr %res
416 define void @contract_xvfnmadd_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
417 ; CONTRACT-FAST-LABEL: contract_xvfnmadd_s:
418 ; CONTRACT-FAST: # %bb.0: # %entry
419 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
420 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
421 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
422 ; CONTRACT-FAST-NEXT: xvfnmadd.s $xr0, $xr0, $xr1, $xr2
423 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
424 ; CONTRACT-FAST-NEXT: ret
426 ; CONTRACT-ON-LABEL: contract_xvfnmadd_s:
427 ; CONTRACT-ON: # %bb.0: # %entry
428 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
429 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
430 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
431 ; CONTRACT-ON-NEXT: xvfnmadd.s $xr0, $xr0, $xr1, $xr2
432 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
433 ; CONTRACT-ON-NEXT: ret
435 ; CONTRACT-OFF-LABEL: contract_xvfnmadd_s:
436 ; CONTRACT-OFF: # %bb.0: # %entry
437 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
438 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
439 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
440 ; CONTRACT-OFF-NEXT: xvfnmadd.s $xr0, $xr0, $xr1, $xr2
441 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
442 ; CONTRACT-OFF-NEXT: ret
444 %v0 = load <8 x float>, ptr %a0
445 %v1 = load <8 x float>, ptr %a1
446 %v2 = load <8 x float>, ptr %a2
447 %mul = fmul contract <8 x float> %v0, %v1
448 %add = fadd contract <8 x float> %mul, %v2
449 %negadd = fneg contract <8 x float> %add
450 store <8 x float> %negadd, ptr %res
454 define void @contract_xvfnmadd_s_nsz(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
455 ; CONTRACT-FAST-LABEL: contract_xvfnmadd_s_nsz:
456 ; CONTRACT-FAST: # %bb.0: # %entry
457 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
458 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
459 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
460 ; CONTRACT-FAST-NEXT: xvfnmadd.s $xr0, $xr0, $xr1, $xr2
461 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
462 ; CONTRACT-FAST-NEXT: ret
464 ; CONTRACT-ON-LABEL: contract_xvfnmadd_s_nsz:
465 ; CONTRACT-ON: # %bb.0: # %entry
466 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
467 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
468 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
469 ; CONTRACT-ON-NEXT: xvfnmadd.s $xr0, $xr0, $xr1, $xr2
470 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
471 ; CONTRACT-ON-NEXT: ret
473 ; CONTRACT-OFF-LABEL: contract_xvfnmadd_s_nsz:
474 ; CONTRACT-OFF: # %bb.0: # %entry
475 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
476 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
477 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
478 ; CONTRACT-OFF-NEXT: xvfnmadd.s $xr0, $xr0, $xr1, $xr2
479 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
480 ; CONTRACT-OFF-NEXT: ret
482 %v0 = load <8 x float>, ptr %a0
483 %v1 = load <8 x float>, ptr %a1
484 %v2 = load <8 x float>, ptr %a2
485 %negv0 = fneg contract nsz<8 x float> %v0
486 %negv2 = fneg contract nsz<8 x float> %v2
487 %mul = fmul contract nsz<8 x float> %negv0, %v1
488 %add = fadd contract nsz<8 x float> %mul, %negv2
489 store <8 x float> %add, ptr %res
493 ;; Check that fnmadd.s is not emitted.
494 define void @not_contract_xvfnmadd_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
495 ; CONTRACT-FAST-LABEL: not_contract_xvfnmadd_s:
496 ; CONTRACT-FAST: # %bb.0: # %entry
497 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
498 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
499 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
500 ; CONTRACT-FAST-NEXT: xvbitrevi.w $xr0, $xr0, 31
501 ; CONTRACT-FAST-NEXT: xvfmsub.s $xr0, $xr0, $xr1, $xr2
502 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
503 ; CONTRACT-FAST-NEXT: ret
505 ; CONTRACT-ON-LABEL: not_contract_xvfnmadd_s:
506 ; CONTRACT-ON: # %bb.0: # %entry
507 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
508 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
509 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
510 ; CONTRACT-ON-NEXT: xvbitrevi.w $xr0, $xr0, 31
511 ; CONTRACT-ON-NEXT: xvfmsub.s $xr0, $xr0, $xr1, $xr2
512 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
513 ; CONTRACT-ON-NEXT: ret
515 ; CONTRACT-OFF-LABEL: not_contract_xvfnmadd_s:
516 ; CONTRACT-OFF: # %bb.0: # %entry
517 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
518 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
519 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
520 ; CONTRACT-OFF-NEXT: xvbitrevi.w $xr0, $xr0, 31
521 ; CONTRACT-OFF-NEXT: xvfmsub.s $xr0, $xr0, $xr1, $xr2
522 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
523 ; CONTRACT-OFF-NEXT: ret
525 %v0 = load <8 x float>, ptr %a0
526 %v1 = load <8 x float>, ptr %a1
527 %v2 = load <8 x float>, ptr %a2
528 %negv0 = fneg contract <8 x float> %v0
529 %negv2 = fneg contract <8 x float> %v2
530 %mul = fmul contract <8 x float> %negv0, %v1
531 %add = fadd contract <8 x float> %mul, %negv2
532 store <8 x float> %add, ptr %res
536 define void @contract_xvfnmsub_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
537 ; CONTRACT-FAST-LABEL: contract_xvfnmsub_s:
538 ; CONTRACT-FAST: # %bb.0: # %entry
539 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
540 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
541 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
542 ; CONTRACT-FAST-NEXT: xvfnmsub.s $xr0, $xr0, $xr1, $xr2
543 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
544 ; CONTRACT-FAST-NEXT: ret
546 ; CONTRACT-ON-LABEL: contract_xvfnmsub_s:
547 ; CONTRACT-ON: # %bb.0: # %entry
548 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
549 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
550 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
551 ; CONTRACT-ON-NEXT: xvfnmsub.s $xr0, $xr0, $xr1, $xr2
552 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
553 ; CONTRACT-ON-NEXT: ret
555 ; CONTRACT-OFF-LABEL: contract_xvfnmsub_s:
556 ; CONTRACT-OFF: # %bb.0: # %entry
557 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
558 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
559 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
560 ; CONTRACT-OFF-NEXT: xvfnmsub.s $xr0, $xr0, $xr1, $xr2
561 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
562 ; CONTRACT-OFF-NEXT: ret
564 %v0 = load <8 x float>, ptr %a0
565 %v1 = load <8 x float>, ptr %a1
566 %v2 = load <8 x float>, ptr %a2
567 %negv2 = fneg contract <8 x float> %v2
568 %mul = fmul contract <8 x float> %v0, %v1
569 %add = fadd contract <8 x float> %mul, %negv2
570 %neg = fneg contract <8 x float> %add
571 store <8 x float> %neg, ptr %res
575 define void @contract_xvfnmsub_s_nsz(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
576 ; CONTRACT-FAST-LABEL: contract_xvfnmsub_s_nsz:
577 ; CONTRACT-FAST: # %bb.0: # %entry
578 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
579 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
580 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
581 ; CONTRACT-FAST-NEXT: xvfnmsub.s $xr0, $xr0, $xr1, $xr2
582 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
583 ; CONTRACT-FAST-NEXT: ret
585 ; CONTRACT-ON-LABEL: contract_xvfnmsub_s_nsz:
586 ; CONTRACT-ON: # %bb.0: # %entry
587 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
588 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
589 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
590 ; CONTRACT-ON-NEXT: xvfnmsub.s $xr0, $xr0, $xr1, $xr2
591 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
592 ; CONTRACT-ON-NEXT: ret
594 ; CONTRACT-OFF-LABEL: contract_xvfnmsub_s_nsz:
595 ; CONTRACT-OFF: # %bb.0: # %entry
596 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
597 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
598 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
599 ; CONTRACT-OFF-NEXT: xvfnmsub.s $xr0, $xr0, $xr1, $xr2
600 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
601 ; CONTRACT-OFF-NEXT: ret
603 %v0 = load <8 x float>, ptr %a0
604 %v1 = load <8 x float>, ptr %a1
605 %v2 = load <8 x float>, ptr %a2
606 %negv0 = fneg contract nsz<8 x float> %v0
607 %mul = fmul contract nsz<8 x float> %negv0, %v1
608 %add = fadd contract nsz<8 x float> %mul, %v2
609 store <8 x float> %add, ptr %res
613 ;; Check that fnmsub.s is not emitted.
614 define void @not_contract_xvfnmsub_s(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
615 ; CONTRACT-FAST-LABEL: not_contract_xvfnmsub_s:
616 ; CONTRACT-FAST: # %bb.0: # %entry
617 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
618 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
619 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
620 ; CONTRACT-FAST-NEXT: xvbitrevi.w $xr0, $xr0, 31
621 ; CONTRACT-FAST-NEXT: xvfmadd.s $xr0, $xr0, $xr1, $xr2
622 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
623 ; CONTRACT-FAST-NEXT: ret
625 ; CONTRACT-ON-LABEL: not_contract_xvfnmsub_s:
626 ; CONTRACT-ON: # %bb.0: # %entry
627 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
628 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
629 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
630 ; CONTRACT-ON-NEXT: xvbitrevi.w $xr0, $xr0, 31
631 ; CONTRACT-ON-NEXT: xvfmadd.s $xr0, $xr0, $xr1, $xr2
632 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
633 ; CONTRACT-ON-NEXT: ret
635 ; CONTRACT-OFF-LABEL: not_contract_xvfnmsub_s:
636 ; CONTRACT-OFF: # %bb.0: # %entry
637 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
638 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
639 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
640 ; CONTRACT-OFF-NEXT: xvbitrevi.w $xr0, $xr0, 31
641 ; CONTRACT-OFF-NEXT: xvfmadd.s $xr0, $xr0, $xr1, $xr2
642 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
643 ; CONTRACT-OFF-NEXT: ret
645 %v0 = load <8 x float>, ptr %a0
646 %v1 = load <8 x float>, ptr %a1
647 %v2 = load <8 x float>, ptr %a2
648 %negv0 = fneg contract <8 x float> %v0
649 %mul = fmul contract <8 x float> %negv0, %v1
650 %add = fadd contract <8 x float> %mul, %v2
651 store <8 x float> %add, ptr %res
655 define void @xvfmadd_s_contract(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
656 ; CONTRACT-FAST-LABEL: xvfmadd_s_contract:
657 ; CONTRACT-FAST: # %bb.0: # %entry
658 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
659 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
660 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
661 ; CONTRACT-FAST-NEXT: xvfmadd.s $xr0, $xr0, $xr1, $xr2
662 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
663 ; CONTRACT-FAST-NEXT: ret
665 ; CONTRACT-ON-LABEL: xvfmadd_s_contract:
666 ; CONTRACT-ON: # %bb.0: # %entry
667 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
668 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
669 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
670 ; CONTRACT-ON-NEXT: xvfmadd.s $xr0, $xr0, $xr1, $xr2
671 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
672 ; CONTRACT-ON-NEXT: ret
674 ; CONTRACT-OFF-LABEL: xvfmadd_s_contract:
675 ; CONTRACT-OFF: # %bb.0: # %entry
676 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
677 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
678 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
679 ; CONTRACT-OFF-NEXT: xvfmadd.s $xr0, $xr0, $xr1, $xr2
680 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
681 ; CONTRACT-OFF-NEXT: ret
683 %v0 = load <8 x float>, ptr %a0
684 %v1 = load <8 x float>, ptr %a1
685 %v2 = load <8 x float>, ptr %a2
686 %mul = fmul contract <8 x float> %v0, %v1
687 %add = fadd contract <8 x float> %mul, %v2
688 store <8 x float> %add, ptr %res
692 define void @xvfmsub_s_contract(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
693 ; CONTRACT-FAST-LABEL: xvfmsub_s_contract:
694 ; CONTRACT-FAST: # %bb.0: # %entry
695 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
696 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
697 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
698 ; CONTRACT-FAST-NEXT: xvfmsub.s $xr0, $xr0, $xr1, $xr2
699 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
700 ; CONTRACT-FAST-NEXT: ret
702 ; CONTRACT-ON-LABEL: xvfmsub_s_contract:
703 ; CONTRACT-ON: # %bb.0: # %entry
704 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
705 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
706 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
707 ; CONTRACT-ON-NEXT: xvfmsub.s $xr0, $xr0, $xr1, $xr2
708 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
709 ; CONTRACT-ON-NEXT: ret
711 ; CONTRACT-OFF-LABEL: xvfmsub_s_contract:
712 ; CONTRACT-OFF: # %bb.0: # %entry
713 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
714 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
715 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
716 ; CONTRACT-OFF-NEXT: xvfmsub.s $xr0, $xr0, $xr1, $xr2
717 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
718 ; CONTRACT-OFF-NEXT: ret
720 %v0 = load <8 x float>, ptr %a0
721 %v1 = load <8 x float>, ptr %a1
722 %v2 = load <8 x float>, ptr %a2
723 %mul = fmul contract <8 x float> %v0, %v1
724 %sub = fsub contract <8 x float> %mul, %v2
725 store <8 x float> %sub, ptr %res
729 define void @xvfnmadd_s_contract(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
730 ; CONTRACT-FAST-LABEL: xvfnmadd_s_contract:
731 ; CONTRACT-FAST: # %bb.0: # %entry
732 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
733 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
734 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
735 ; CONTRACT-FAST-NEXT: xvfnmadd.s $xr0, $xr0, $xr1, $xr2
736 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
737 ; CONTRACT-FAST-NEXT: ret
739 ; CONTRACT-ON-LABEL: xvfnmadd_s_contract:
740 ; CONTRACT-ON: # %bb.0: # %entry
741 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
742 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
743 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
744 ; CONTRACT-ON-NEXT: xvfnmadd.s $xr0, $xr0, $xr1, $xr2
745 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
746 ; CONTRACT-ON-NEXT: ret
748 ; CONTRACT-OFF-LABEL: xvfnmadd_s_contract:
749 ; CONTRACT-OFF: # %bb.0: # %entry
750 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
751 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
752 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
753 ; CONTRACT-OFF-NEXT: xvfnmadd.s $xr0, $xr0, $xr1, $xr2
754 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
755 ; CONTRACT-OFF-NEXT: ret
757 %v0 = load <8 x float>, ptr %a0
758 %v1 = load <8 x float>, ptr %a1
759 %v2 = load <8 x float>, ptr %a2
760 %mul = fmul contract <8 x float> %v0, %v1
761 %add = fadd contract <8 x float> %mul, %v2
762 %negadd = fneg contract <8 x float> %add
763 store <8 x float> %negadd, ptr %res
767 define void @xvfnmsub_s_contract(ptr %res, ptr %a0, ptr %a1, ptr %a2) nounwind {
768 ; CONTRACT-FAST-LABEL: xvfnmsub_s_contract:
769 ; CONTRACT-FAST: # %bb.0: # %entry
770 ; CONTRACT-FAST-NEXT: xvld $xr0, $a1, 0
771 ; CONTRACT-FAST-NEXT: xvld $xr1, $a2, 0
772 ; CONTRACT-FAST-NEXT: xvld $xr2, $a3, 0
773 ; CONTRACT-FAST-NEXT: xvfnmsub.s $xr0, $xr0, $xr1, $xr2
774 ; CONTRACT-FAST-NEXT: xvst $xr0, $a0, 0
775 ; CONTRACT-FAST-NEXT: ret
777 ; CONTRACT-ON-LABEL: xvfnmsub_s_contract:
778 ; CONTRACT-ON: # %bb.0: # %entry
779 ; CONTRACT-ON-NEXT: xvld $xr0, $a1, 0
780 ; CONTRACT-ON-NEXT: xvld $xr1, $a2, 0
781 ; CONTRACT-ON-NEXT: xvld $xr2, $a3, 0
782 ; CONTRACT-ON-NEXT: xvfnmsub.s $xr0, $xr0, $xr1, $xr2
783 ; CONTRACT-ON-NEXT: xvst $xr0, $a0, 0
784 ; CONTRACT-ON-NEXT: ret
786 ; CONTRACT-OFF-LABEL: xvfnmsub_s_contract:
787 ; CONTRACT-OFF: # %bb.0: # %entry
788 ; CONTRACT-OFF-NEXT: xvld $xr0, $a1, 0
789 ; CONTRACT-OFF-NEXT: xvld $xr1, $a2, 0
790 ; CONTRACT-OFF-NEXT: xvld $xr2, $a3, 0
791 ; CONTRACT-OFF-NEXT: xvfnmsub.s $xr0, $xr0, $xr1, $xr2
792 ; CONTRACT-OFF-NEXT: xvst $xr0, $a0, 0
793 ; CONTRACT-OFF-NEXT: ret
795 %v0 = load <8 x float>, ptr %a0
796 %v1 = load <8 x float>, ptr %a1
797 %v2 = load <8 x float>, ptr %a2
798 %mul = fmul contract <8 x float> %v0, %v1
799 %negv2 = fneg contract <8 x float> %v2
800 %add = fadd contract <8 x float> %negv2, %mul
801 %negadd = fneg contract <8 x float> %add
802 store <8 x float> %negadd, ptr %res