1 ; Test vector negative multiply-and-add on z14.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
5 declare <2 x double> @llvm.fma.v2f64(<2 x double>, <2 x double>, <2 x double>)
6 declare <4 x float> @llvm.fma.v4f32(<4 x float>, <4 x float>, <4 x float>)
8 ; Test a v2f64 negative multiply-and-add.
9 define <2 x double> @f1(<2 x double> %dummy, <2 x double> %val1,
10 <2 x double> %val2, <2 x double> %val3) {
12 ; CHECK: vfnmadb %v24, %v26, %v28, %v30
14 %ret = call <2 x double> @llvm.fma.v2f64 (<2 x double> %val1,
17 %negret = fsub <2 x double> <double -0.0, double -0.0>, %ret
18 ret <2 x double> %negret
21 ; Test a v2f64 negative multiply-and-subtract.
22 define <2 x double> @f2(<2 x double> %dummy, <2 x double> %val1,
23 <2 x double> %val2, <2 x double> %val3) {
25 ; CHECK: vfnmsdb %v24, %v26, %v28, %v30
27 %negval3 = fsub <2 x double> <double -0.0, double -0.0>, %val3
28 %ret = call <2 x double> @llvm.fma.v2f64 (<2 x double> %val1,
30 <2 x double> %negval3)
31 %negret = fsub <2 x double> <double -0.0, double -0.0>, %ret
32 ret <2 x double> %negret
35 ; Test a v4f32 negative multiply-and-add.
36 define <4 x float> @f3(<4 x float> %dummy, <4 x float> %val1,
37 <4 x float> %val2, <4 x float> %val3) {
39 ; CHECK: vfnmasb %v24, %v26, %v28, %v30
41 %ret = call <4 x float> @llvm.fma.v4f32 (<4 x float> %val1,
44 %negret = fsub <4 x float> <float -0.0, float -0.0,
45 float -0.0, float -0.0>, %ret
46 ret <4 x float> %negret
49 ; Test a v4f32 negative multiply-and-subtract.
50 define <4 x float> @f4(<4 x float> %dummy, <4 x float> %val1,
51 <4 x float> %val2, <4 x float> %val3) {
53 ; CHECK: vfnmssb %v24, %v26, %v28, %v30
55 %negval3 = fsub <4 x float> <float -0.0, float -0.0,
56 float -0.0, float -0.0>, %val3
57 %ret = call <4 x float> @llvm.fma.v4f32 (<4 x float> %val1,
60 %negret = fsub <4 x float> <float -0.0, float -0.0,
61 float -0.0, float -0.0>, %ret
62 ret <4 x float> %negret