1; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
2
3declare double @llvm.fma.f64(double %f1, double %f2, double %f3)
4declare float @llvm.fma.f32(float %f1, float %f2, float %f3)
5
6define double @f1(double %f1, double %f2, double %acc) {
7; CHECK-LABEL: f1:
8; CHECK: wfnmadb %f0, %f0, %f2, %f4
9; CHECK: br %r14
10  %res = call double @llvm.fma.f64 (double %f1, double %f2, double %acc)
11  %negres = fneg double %res
12  ret double %negres
13}
14
15define double @f2(double %f1, double %f2, double %acc) {
16; CHECK-LABEL: f2:
17; CHECK: wfnmsdb %f0, %f0, %f2, %f4
18; CHECK: br %r14
19  %negacc = fneg double %acc
20  %res = call double @llvm.fma.f64 (double %f1, double %f2, double %negacc)
21  %negres = fneg double %res
22  ret double %negres
23}
24
25define float @f3(float %f1, float %f2, float %acc) {
26; CHECK-LABEL: f3:
27; CHECK: wfnmasb %f0, %f0, %f2, %f4
28; CHECK: br %r14
29  %res = call float @llvm.fma.f32 (float %f1, float %f2, float %acc)
30  %negres = fneg float %res
31  ret float %negres
32}
33
34define float @f4(float %f1, float %f2, float %acc) {
35; CHECK-LABEL: f4:
36; CHECK: wfnmssb %f0, %f0, %f2, %f4
37; CHECK: br %r14
38  %negacc = fneg float %acc
39  %res = call float @llvm.fma.f32 (float %f1, float %f2, float %negacc)
40  %negres = fneg float %res
41  ret float %negres
42}
43
44