blob: f22f85d5d79080db81f7d329f02fea03b9011593 [file] [log] [blame]
Alex Bradbury76c29ee2018-03-20 12:45:35 +00001; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=riscv32 -mattr=+f -verify-machineinstrs < %s \
3; RUN: | FileCheck -check-prefix=RV32IF %s
Alex Bradburyd834d832019-01-31 22:48:38 +00004; RUN: llc -mtriple=riscv64 -mattr=+f -verify-machineinstrs < %s \
5; RUN: | FileCheck -check-prefix=RV64IF %s
Alex Bradbury76c29ee2018-03-20 12:45:35 +00006
Alex Bradbury919f5fb2018-12-13 10:49:05 +00007; These tests are each targeted at a particular RISC-V FPU instruction. Most
8; other files in this folder exercise LLVM IR instructions that don't directly
9; match a RISC-V instruction.
10
Alex Bradbury76c29ee2018-03-20 12:45:35 +000011define float @fadd_s(float %a, float %b) nounwind {
12; RV32IF-LABEL: fadd_s:
13; RV32IF: # %bb.0:
14; RV32IF-NEXT: fmv.w.x ft0, a1
15; RV32IF-NEXT: fmv.w.x ft1, a0
16; RV32IF-NEXT: fadd.s ft0, ft1, ft0
17; RV32IF-NEXT: fmv.x.w a0, ft0
18; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +000019;
20; RV64IF-LABEL: fadd_s:
21; RV64IF: # %bb.0:
22; RV64IF-NEXT: fmv.w.x ft0, a1
23; RV64IF-NEXT: fmv.w.x ft1, a0
24; RV64IF-NEXT: fadd.s ft0, ft1, ft0
25; RV64IF-NEXT: fmv.x.w a0, ft0
26; RV64IF-NEXT: ret
Alex Bradbury76c29ee2018-03-20 12:45:35 +000027 %1 = fadd float %a, %b
28 ret float %1
29}
30
31define float @fsub_s(float %a, float %b) nounwind {
32; RV32IF-LABEL: fsub_s:
33; RV32IF: # %bb.0:
34; RV32IF-NEXT: fmv.w.x ft0, a1
35; RV32IF-NEXT: fmv.w.x ft1, a0
36; RV32IF-NEXT: fsub.s ft0, ft1, ft0
37; RV32IF-NEXT: fmv.x.w a0, ft0
38; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +000039;
40; RV64IF-LABEL: fsub_s:
41; RV64IF: # %bb.0:
42; RV64IF-NEXT: fmv.w.x ft0, a1
43; RV64IF-NEXT: fmv.w.x ft1, a0
44; RV64IF-NEXT: fsub.s ft0, ft1, ft0
45; RV64IF-NEXT: fmv.x.w a0, ft0
46; RV64IF-NEXT: ret
Alex Bradbury76c29ee2018-03-20 12:45:35 +000047 %1 = fsub float %a, %b
48 ret float %1
49}
50
51define float @fmul_s(float %a, float %b) nounwind {
52; RV32IF-LABEL: fmul_s:
53; RV32IF: # %bb.0:
54; RV32IF-NEXT: fmv.w.x ft0, a1
55; RV32IF-NEXT: fmv.w.x ft1, a0
56; RV32IF-NEXT: fmul.s ft0, ft1, ft0
57; RV32IF-NEXT: fmv.x.w a0, ft0
58; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +000059;
60; RV64IF-LABEL: fmul_s:
61; RV64IF: # %bb.0:
62; RV64IF-NEXT: fmv.w.x ft0, a1
63; RV64IF-NEXT: fmv.w.x ft1, a0
64; RV64IF-NEXT: fmul.s ft0, ft1, ft0
65; RV64IF-NEXT: fmv.x.w a0, ft0
66; RV64IF-NEXT: ret
Alex Bradbury76c29ee2018-03-20 12:45:35 +000067 %1 = fmul float %a, %b
68 ret float %1
69}
70
71define float @fdiv_s(float %a, float %b) nounwind {
72; RV32IF-LABEL: fdiv_s:
73; RV32IF: # %bb.0:
74; RV32IF-NEXT: fmv.w.x ft0, a1
75; RV32IF-NEXT: fmv.w.x ft1, a0
76; RV32IF-NEXT: fdiv.s ft0, ft1, ft0
77; RV32IF-NEXT: fmv.x.w a0, ft0
78; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +000079;
80; RV64IF-LABEL: fdiv_s:
81; RV64IF: # %bb.0:
82; RV64IF-NEXT: fmv.w.x ft0, a1
83; RV64IF-NEXT: fmv.w.x ft1, a0
84; RV64IF-NEXT: fdiv.s ft0, ft1, ft0
85; RV64IF-NEXT: fmv.x.w a0, ft0
86; RV64IF-NEXT: ret
Alex Bradbury76c29ee2018-03-20 12:45:35 +000087 %1 = fdiv float %a, %b
88 ret float %1
89}
90
91declare float @llvm.sqrt.f32(float)
92
93define float @fsqrt_s(float %a) nounwind {
94; RV32IF-LABEL: fsqrt_s:
95; RV32IF: # %bb.0:
96; RV32IF-NEXT: fmv.w.x ft0, a0
97; RV32IF-NEXT: fsqrt.s ft0, ft0
98; RV32IF-NEXT: fmv.x.w a0, ft0
99; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000100;
101; RV64IF-LABEL: fsqrt_s:
102; RV64IF: # %bb.0:
103; RV64IF-NEXT: fmv.w.x ft0, a0
104; RV64IF-NEXT: fsqrt.s ft0, ft0
105; RV64IF-NEXT: fmv.x.w a0, ft0
106; RV64IF-NEXT: ret
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000107 %1 = call float @llvm.sqrt.f32(float %a)
108 ret float %1
109}
110
111declare float @llvm.copysign.f32(float, float)
112
113define float @fsgnj_s(float %a, float %b) nounwind {
114; RV32IF-LABEL: fsgnj_s:
115; RV32IF: # %bb.0:
116; RV32IF-NEXT: fmv.w.x ft0, a1
117; RV32IF-NEXT: fmv.w.x ft1, a0
118; RV32IF-NEXT: fsgnj.s ft0, ft1, ft0
119; RV32IF-NEXT: fmv.x.w a0, ft0
120; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000121;
122; RV64IF-LABEL: fsgnj_s:
123; RV64IF: # %bb.0:
124; RV64IF-NEXT: fmv.w.x ft0, a1
125; RV64IF-NEXT: fmv.w.x ft1, a0
126; RV64IF-NEXT: fsgnj.s ft0, ft1, ft0
127; RV64IF-NEXT: fmv.x.w a0, ft0
128; RV64IF-NEXT: ret
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000129 %1 = call float @llvm.copysign.f32(float %a, float %b)
130 ret float %1
131}
132
Alex Bradbury38c4ec32019-01-25 14:33:08 +0000133; This function performs extra work to ensure that
134; DAGCombiner::visitBITCAST doesn't replace the fneg with an xor.
135define i32 @fneg_s(float %a, float %b) nounwind {
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000136; RV32IF-LABEL: fneg_s:
137; RV32IF: # %bb.0:
Alex Bradbury38c4ec32019-01-25 14:33:08 +0000138; RV32IF-NEXT: fmv.w.x ft0, a0
139; RV32IF-NEXT: fadd.s ft0, ft0, ft0
140; RV32IF-NEXT: fneg.s ft1, ft0
141; RV32IF-NEXT: feq.s a0, ft0, ft1
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000142; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000143;
144; RV64IF-LABEL: fneg_s:
145; RV64IF: # %bb.0:
146; RV64IF-NEXT: fmv.w.x ft0, a0
147; RV64IF-NEXT: fadd.s ft0, ft0, ft0
148; RV64IF-NEXT: fneg.s ft1, ft0
149; RV64IF-NEXT: feq.s a0, ft0, ft1
150; RV64IF-NEXT: ret
Alex Bradbury38c4ec32019-01-25 14:33:08 +0000151 %1 = fadd float %a, %a
152 %2 = fneg float %1
153 %3 = fcmp oeq float %1, %2
154 %4 = zext i1 %3 to i32
155 ret i32 %4
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000156}
157
Alex Bradbury38c4ec32019-01-25 14:33:08 +0000158; This function performs extra work to ensure that
159; DAGCombiner::visitBITCAST doesn't replace the fneg with an xor.
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000160define float @fsgnjn_s(float %a, float %b) nounwind {
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000161; RV32IF-LABEL: fsgnjn_s:
162; RV32IF: # %bb.0:
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000163; RV32IF-NEXT: fmv.w.x ft0, a1
164; RV32IF-NEXT: fmv.w.x ft1, a0
Alex Bradbury38c4ec32019-01-25 14:33:08 +0000165; RV32IF-NEXT: fadd.s ft0, ft1, ft0
166; RV32IF-NEXT: fsgnjn.s ft0, ft1, ft0
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000167; RV32IF-NEXT: fmv.x.w a0, ft0
168; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000169;
170; RV64IF-LABEL: fsgnjn_s:
171; RV64IF: # %bb.0:
172; RV64IF-NEXT: fmv.w.x ft0, a1
173; RV64IF-NEXT: fmv.w.x ft1, a0
174; RV64IF-NEXT: fadd.s ft0, ft1, ft0
175; RV64IF-NEXT: fsgnjn.s ft0, ft1, ft0
176; RV64IF-NEXT: fmv.x.w a0, ft0
177; RV64IF-NEXT: ret
Alex Bradbury38c4ec32019-01-25 14:33:08 +0000178 %1 = fadd float %a, %b
179 %2 = fneg float %1
180 %3 = call float @llvm.copysign.f32(float %a, float %2)
181 ret float %3
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000182}
183
184declare float @llvm.fabs.f32(float)
185
Alex Bradbury38c4ec32019-01-25 14:33:08 +0000186; This function performs extra work to ensure that
187; DAGCombiner::visitBITCAST doesn't replace the fabs with an and.
188define float @fabs_s(float %a, float %b) nounwind {
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000189; RV32IF-LABEL: fabs_s:
190; RV32IF: # %bb.0:
Alex Bradbury38c4ec32019-01-25 14:33:08 +0000191; RV32IF-NEXT: fmv.w.x ft0, a1
192; RV32IF-NEXT: fmv.w.x ft1, a0
193; RV32IF-NEXT: fadd.s ft0, ft1, ft0
194; RV32IF-NEXT: fabs.s ft1, ft0
195; RV32IF-NEXT: fadd.s ft0, ft1, ft0
196; RV32IF-NEXT: fmv.x.w a0, ft0
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000197; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000198;
199; RV64IF-LABEL: fabs_s:
200; RV64IF: # %bb.0:
201; RV64IF-NEXT: fmv.w.x ft0, a1
202; RV64IF-NEXT: fmv.w.x ft1, a0
203; RV64IF-NEXT: fadd.s ft0, ft1, ft0
204; RV64IF-NEXT: fabs.s ft1, ft0
205; RV64IF-NEXT: fadd.s ft0, ft1, ft0
206; RV64IF-NEXT: fmv.x.w a0, ft0
207; RV64IF-NEXT: ret
Alex Bradbury38c4ec32019-01-25 14:33:08 +0000208 %1 = fadd float %a, %b
209 %2 = call float @llvm.fabs.f32(float %1)
210 %3 = fadd float %2, %1
211 ret float %3
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000212}
213
214declare float @llvm.minnum.f32(float, float)
215
216define float @fmin_s(float %a, float %b) nounwind {
217; RV32IF-LABEL: fmin_s:
218; RV32IF: # %bb.0:
219; RV32IF-NEXT: fmv.w.x ft0, a1
220; RV32IF-NEXT: fmv.w.x ft1, a0
221; RV32IF-NEXT: fmin.s ft0, ft1, ft0
222; RV32IF-NEXT: fmv.x.w a0, ft0
223; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000224;
225; RV64IF-LABEL: fmin_s:
226; RV64IF: # %bb.0:
227; RV64IF-NEXT: fmv.w.x ft0, a1
228; RV64IF-NEXT: fmv.w.x ft1, a0
229; RV64IF-NEXT: fmin.s ft0, ft1, ft0
230; RV64IF-NEXT: fmv.x.w a0, ft0
231; RV64IF-NEXT: ret
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000232 %1 = call float @llvm.minnum.f32(float %a, float %b)
233 ret float %1
234}
235
236declare float @llvm.maxnum.f32(float, float)
237
238define float @fmax_s(float %a, float %b) nounwind {
239; RV32IF-LABEL: fmax_s:
240; RV32IF: # %bb.0:
241; RV32IF-NEXT: fmv.w.x ft0, a1
242; RV32IF-NEXT: fmv.w.x ft1, a0
243; RV32IF-NEXT: fmax.s ft0, ft1, ft0
244; RV32IF-NEXT: fmv.x.w a0, ft0
245; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000246;
247; RV64IF-LABEL: fmax_s:
248; RV64IF: # %bb.0:
249; RV64IF-NEXT: fmv.w.x ft0, a1
250; RV64IF-NEXT: fmv.w.x ft1, a0
251; RV64IF-NEXT: fmax.s ft0, ft1, ft0
252; RV64IF-NEXT: fmv.x.w a0, ft0
253; RV64IF-NEXT: ret
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000254 %1 = call float @llvm.maxnum.f32(float %a, float %b)
255 ret float %1
256}
257
258define i32 @feq_s(float %a, float %b) nounwind {
259; RV32IF-LABEL: feq_s:
260; RV32IF: # %bb.0:
261; RV32IF-NEXT: fmv.w.x ft0, a1
262; RV32IF-NEXT: fmv.w.x ft1, a0
263; RV32IF-NEXT: feq.s a0, ft1, ft0
264; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000265;
266; RV64IF-LABEL: feq_s:
267; RV64IF: # %bb.0:
268; RV64IF-NEXT: fmv.w.x ft0, a1
269; RV64IF-NEXT: fmv.w.x ft1, a0
270; RV64IF-NEXT: feq.s a0, ft1, ft0
271; RV64IF-NEXT: ret
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000272 %1 = fcmp oeq float %a, %b
273 %2 = zext i1 %1 to i32
274 ret i32 %2
275}
276
277define i32 @flt_s(float %a, float %b) nounwind {
278; RV32IF-LABEL: flt_s:
279; RV32IF: # %bb.0:
280; RV32IF-NEXT: fmv.w.x ft0, a1
281; RV32IF-NEXT: fmv.w.x ft1, a0
282; RV32IF-NEXT: flt.s a0, ft1, ft0
283; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000284;
285; RV64IF-LABEL: flt_s:
286; RV64IF: # %bb.0:
287; RV64IF-NEXT: fmv.w.x ft0, a1
288; RV64IF-NEXT: fmv.w.x ft1, a0
289; RV64IF-NEXT: flt.s a0, ft1, ft0
290; RV64IF-NEXT: ret
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000291 %1 = fcmp olt float %a, %b
292 %2 = zext i1 %1 to i32
293 ret i32 %2
294}
295
296define i32 @fle_s(float %a, float %b) nounwind {
297; RV32IF-LABEL: fle_s:
298; RV32IF: # %bb.0:
299; RV32IF-NEXT: fmv.w.x ft0, a1
300; RV32IF-NEXT: fmv.w.x ft1, a0
301; RV32IF-NEXT: fle.s a0, ft1, ft0
302; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000303;
304; RV64IF-LABEL: fle_s:
305; RV64IF: # %bb.0:
306; RV64IF-NEXT: fmv.w.x ft0, a1
307; RV64IF-NEXT: fmv.w.x ft1, a0
308; RV64IF-NEXT: fle.s a0, ft1, ft0
309; RV64IF-NEXT: ret
Alex Bradbury76c29ee2018-03-20 12:45:35 +0000310 %1 = fcmp ole float %a, %b
311 %2 = zext i1 %1 to i32
312 ret i32 %2
313}
Alex Bradbury919f5fb2018-12-13 10:49:05 +0000314
315declare float @llvm.fma.f32(float, float, float)
316
317define float @fmadd_s(float %a, float %b, float %c) nounwind {
318; RV32IF-LABEL: fmadd_s:
319; RV32IF: # %bb.0:
320; RV32IF-NEXT: fmv.w.x ft0, a2
321; RV32IF-NEXT: fmv.w.x ft1, a1
322; RV32IF-NEXT: fmv.w.x ft2, a0
323; RV32IF-NEXT: fmadd.s ft0, ft2, ft1, ft0
324; RV32IF-NEXT: fmv.x.w a0, ft0
325; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000326;
327; RV64IF-LABEL: fmadd_s:
328; RV64IF: # %bb.0:
329; RV64IF-NEXT: fmv.w.x ft0, a2
330; RV64IF-NEXT: fmv.w.x ft1, a1
331; RV64IF-NEXT: fmv.w.x ft2, a0
332; RV64IF-NEXT: fmadd.s ft0, ft2, ft1, ft0
333; RV64IF-NEXT: fmv.x.w a0, ft0
334; RV64IF-NEXT: ret
Alex Bradbury919f5fb2018-12-13 10:49:05 +0000335 %1 = call float @llvm.fma.f32(float %a, float %b, float %c)
336 ret float %1
337}
338
339define float @fmsub_s(float %a, float %b, float %c) nounwind {
340; RV32IF-LABEL: fmsub_s:
341; RV32IF: # %bb.0:
Roger Ferrer Ibanez3c24aee2020-03-20 09:22:48 +0000342; RV32IF-NEXT: fmv.w.x ft0, a1
343; RV32IF-NEXT: fmv.w.x ft1, a0
344; RV32IF-NEXT: fmv.w.x ft2, a2
345; RV32IF-NEXT: fmv.w.x ft3, zero
346; RV32IF-NEXT: fadd.s ft2, ft2, ft3
347; RV32IF-NEXT: fmsub.s ft0, ft1, ft0, ft2
Alex Bradbury919f5fb2018-12-13 10:49:05 +0000348; RV32IF-NEXT: fmv.x.w a0, ft0
349; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000350;
351; RV64IF-LABEL: fmsub_s:
352; RV64IF: # %bb.0:
Roger Ferrer Ibanez3c24aee2020-03-20 09:22:48 +0000353; RV64IF-NEXT: fmv.w.x ft0, a1
354; RV64IF-NEXT: fmv.w.x ft1, a0
355; RV64IF-NEXT: fmv.w.x ft2, a2
356; RV64IF-NEXT: fmv.w.x ft3, zero
357; RV64IF-NEXT: fadd.s ft2, ft2, ft3
358; RV64IF-NEXT: fmsub.s ft0, ft1, ft0, ft2
Alex Bradburyd834d832019-01-31 22:48:38 +0000359; RV64IF-NEXT: fmv.x.w a0, ft0
360; RV64IF-NEXT: ret
Alex Bradbury919f5fb2018-12-13 10:49:05 +0000361 %c_ = fadd float 0.0, %c ; avoid negation using xor
362 %negc = fsub float -0.0, %c_
363 %1 = call float @llvm.fma.f32(float %a, float %b, float %negc)
364 ret float %1
365}
366
367define float @fnmadd_s(float %a, float %b, float %c) nounwind {
368; RV32IF-LABEL: fnmadd_s:
369; RV32IF: # %bb.0:
Roger Ferrer Ibanez3c24aee2020-03-20 09:22:48 +0000370; RV32IF-NEXT: fmv.w.x ft0, a1
371; RV32IF-NEXT: fmv.w.x ft1, a2
372; RV32IF-NEXT: fmv.w.x ft2, a0
373; RV32IF-NEXT: fmv.w.x ft3, zero
374; RV32IF-NEXT: fadd.s ft2, ft2, ft3
375; RV32IF-NEXT: fadd.s ft1, ft1, ft3
376; RV32IF-NEXT: fnmadd.s ft0, ft2, ft0, ft1
Alex Bradbury919f5fb2018-12-13 10:49:05 +0000377; RV32IF-NEXT: fmv.x.w a0, ft0
378; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000379;
380; RV64IF-LABEL: fnmadd_s:
381; RV64IF: # %bb.0:
Roger Ferrer Ibanez3c24aee2020-03-20 09:22:48 +0000382; RV64IF-NEXT: fmv.w.x ft0, a1
383; RV64IF-NEXT: fmv.w.x ft1, a2
384; RV64IF-NEXT: fmv.w.x ft2, a0
385; RV64IF-NEXT: fmv.w.x ft3, zero
386; RV64IF-NEXT: fadd.s ft2, ft2, ft3
387; RV64IF-NEXT: fadd.s ft1, ft1, ft3
388; RV64IF-NEXT: fnmadd.s ft0, ft2, ft0, ft1
Alex Bradburyd834d832019-01-31 22:48:38 +0000389; RV64IF-NEXT: fmv.x.w a0, ft0
390; RV64IF-NEXT: ret
Alex Bradbury919f5fb2018-12-13 10:49:05 +0000391 %a_ = fadd float 0.0, %a
392 %c_ = fadd float 0.0, %c
393 %nega = fsub float -0.0, %a_
394 %negc = fsub float -0.0, %c_
395 %1 = call float @llvm.fma.f32(float %nega, float %b, float %negc)
396 ret float %1
397}
398
399define float @fnmsub_s(float %a, float %b, float %c) nounwind {
400; RV32IF-LABEL: fnmsub_s:
401; RV32IF: # %bb.0:
Roger Ferrer Ibanez3c24aee2020-03-20 09:22:48 +0000402; RV32IF-NEXT: fmv.w.x ft0, a2
403; RV32IF-NEXT: fmv.w.x ft1, a1
404; RV32IF-NEXT: fmv.w.x ft2, a0
405; RV32IF-NEXT: fmv.w.x ft3, zero
406; RV32IF-NEXT: fadd.s ft2, ft2, ft3
407; RV32IF-NEXT: fnmsub.s ft0, ft2, ft1, ft0
Alex Bradbury919f5fb2018-12-13 10:49:05 +0000408; RV32IF-NEXT: fmv.x.w a0, ft0
409; RV32IF-NEXT: ret
Alex Bradburyd834d832019-01-31 22:48:38 +0000410;
411; RV64IF-LABEL: fnmsub_s:
412; RV64IF: # %bb.0:
Roger Ferrer Ibanez3c24aee2020-03-20 09:22:48 +0000413; RV64IF-NEXT: fmv.w.x ft0, a2
414; RV64IF-NEXT: fmv.w.x ft1, a1
415; RV64IF-NEXT: fmv.w.x ft2, a0
416; RV64IF-NEXT: fmv.w.x ft3, zero
417; RV64IF-NEXT: fadd.s ft2, ft2, ft3
418; RV64IF-NEXT: fnmsub.s ft0, ft2, ft1, ft0
Alex Bradburyd834d832019-01-31 22:48:38 +0000419; RV64IF-NEXT: fmv.x.w a0, ft0
420; RV64IF-NEXT: ret
Alex Bradbury919f5fb2018-12-13 10:49:05 +0000421 %a_ = fadd float 0.0, %a
422 %nega = fsub float -0.0, %a_
423 %1 = call float @llvm.fma.f32(float %nega, float %b, float %c)
424 ret float %1
425}