1 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
3 declare fp128 @llvm.fma.f128(fp128 %f1, fp128 %f2, fp128 %f3)
5 define void @f1(fp128 *%ptr1, fp128 *%ptr2, fp128 *%ptr3, fp128 *%dst) {
7 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
8 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
9 ; CHECK-DAG: vl [[REG3:%v[0-9]+]], 0(%r4)
10 ; CHECK: wfmaxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], [[REG3]]
11 ; CHECK: vst [[RES]], 0(%r5)
13 %f1 = load fp128, fp128 *%ptr1
14 %f2 = load fp128, fp128 *%ptr2
15 %f3 = load fp128, fp128 *%ptr3
16 %res = call fp128 @llvm.fma.f128 (fp128 %f1, fp128 %f2, fp128 %f3)
17 store fp128 %res, fp128 *%dst
21 define void @f2(fp128 *%ptr1, fp128 *%ptr2, fp128 *%ptr3, fp128 *%dst) {
23 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
24 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
25 ; CHECK-DAG: vl [[REG3:%v[0-9]+]], 0(%r4)
26 ; CHECK: wfmsxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], [[REG3]]
27 ; CHECK: vst [[RES]], 0(%r5)
29 %f1 = load fp128, fp128 *%ptr1
30 %f2 = load fp128, fp128 *%ptr2
31 %f3 = load fp128, fp128 *%ptr3
32 %neg = fsub fp128 0xL00000000000000008000000000000000, %f3
33 %res = call fp128 @llvm.fma.f128 (fp128 %f1, fp128 %f2, fp128 %neg)
34 store fp128 %res, fp128 *%dst
38 define void @f3(fp128 *%ptr1, fp128 *%ptr2, fp128 *%ptr3, fp128 *%dst) {
40 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
41 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
42 ; CHECK-DAG: vl [[REG3:%v[0-9]+]], 0(%r4)
43 ; CHECK: wfnmaxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], [[REG3]]
44 ; CHECK: vst [[RES]], 0(%r5)
46 %f1 = load fp128, fp128 *%ptr1
47 %f2 = load fp128, fp128 *%ptr2
48 %f3 = load fp128, fp128 *%ptr3
49 %res = call fp128 @llvm.fma.f128 (fp128 %f1, fp128 %f2, fp128 %f3)
50 %negres = fsub fp128 0xL00000000000000008000000000000000, %res
51 store fp128 %negres, fp128 *%dst
55 define void @f4(fp128 *%ptr1, fp128 *%ptr2, fp128 *%ptr3, fp128 *%dst) {
57 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
58 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
59 ; CHECK-DAG: vl [[REG3:%v[0-9]+]], 0(%r4)
60 ; CHECK: wfnmsxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], [[REG3]]
61 ; CHECK: vst [[RES]], 0(%r5)
63 %f1 = load fp128, fp128 *%ptr1
64 %f2 = load fp128, fp128 *%ptr2
65 %f3 = load fp128, fp128 *%ptr3
66 %neg = fsub fp128 0xL00000000000000008000000000000000, %f3
67 %res = call fp128 @llvm.fma.f128 (fp128 %f1, fp128 %f2, fp128 %neg)
68 %negres = fsub fp128 0xL00000000000000008000000000000000, %res
69 store fp128 %negres, fp128 *%dst