blob: c23a6a202ad5f380755a751adc1b353b381e1639 [file] [log] [blame]
Ulrich Weigand2b3482f2017-07-17 17:41:11 +00001; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
2
3declare double @llvm.fma.f64(double %f1, double %f2, double %f3)
Ulrich Weigand33435c42017-07-17 17:42:48 +00004declare float @llvm.fma.f32(float %f1, float %f2, float %f3)
Ulrich Weigand2b3482f2017-07-17 17:41:11 +00005
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 = fsub double -0.0, %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 = fsub double -0.0, %acc
20 %res = call double @llvm.fma.f64 (double %f1, double %f2, double %negacc)
21 %negres = fsub double -0.0, %res
22 ret double %negres
23}
24
Ulrich Weigand33435c42017-07-17 17:42:48 +000025define 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 = fsub float -0.0, %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 = fsub float -0.0, %acc
39 %res = call float @llvm.fma.f32 (float %f1, float %f2, float %negacc)
40 %negres = fsub float -0.0, %res
41 ret float %negres
42}
43