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 = fneg <2 x double> %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 = fneg <2 x double> %val3
28 %ret = call <2 x double> @llvm.fma.v2f64 (<2 x double> %val1,
30 <2 x double> %negval3)
31 %negret = fneg <2 x double> %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 = fneg <4 x float> %ret
45 ret <4 x float> %negret
48 ; Test a v4f32 negative multiply-and-subtract.
49 define <4 x float> @f4(<4 x float> %dummy, <4 x float> %val1,
50 <4 x float> %val2, <4 x float> %val3) {
52 ; CHECK: vfnmssb %v24, %v26, %v28, %v30
54 %negval3 = fneg <4 x float> %val3
55 %ret = call <4 x float> @llvm.fma.v4f32 (<4 x float> %val1,
58 %negret = fneg <4 x float> %ret
59 ret <4 x float> %negret