1 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
3 declare fp128 @llvm.experimental.constrained.fma.f128(fp128 %f1, fp128 %f2, fp128 %f3, metadata, metadata)
5 define void @f1(ptr %ptr1, ptr %ptr2, ptr %ptr3, ptr %dst) #0 {
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, ptr %ptr1
14 %f2 = load fp128, ptr %ptr2
15 %f3 = load fp128, ptr %ptr3
16 %res = call fp128 @llvm.experimental.constrained.fma.f128 (
17 fp128 %f1, fp128 %f2, fp128 %f3,
18 metadata !"round.dynamic",
19 metadata !"fpexcept.strict") #0
20 store fp128 %res, ptr %dst
24 define void @f2(ptr %ptr1, ptr %ptr2, ptr %ptr3, ptr %dst) #0 {
26 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
27 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
28 ; CHECK-DAG: vl [[REG3:%v[0-9]+]], 0(%r4)
29 ; CHECK: wfmsxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], [[REG3]]
30 ; CHECK: vst [[RES]], 0(%r5)
32 %f1 = load fp128, ptr %ptr1
33 %f2 = load fp128, ptr %ptr2
34 %f3 = load fp128, ptr %ptr3
35 %neg = fsub fp128 0xL00000000000000008000000000000000, %f3
36 %res = call fp128 @llvm.experimental.constrained.fma.f128 (
37 fp128 %f1, fp128 %f2, fp128 %neg,
38 metadata !"round.dynamic",
39 metadata !"fpexcept.strict") #0
40 store fp128 %res, ptr %dst
44 define void @f3(ptr %ptr1, ptr %ptr2, ptr %ptr3, ptr %dst) #0 {
46 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
47 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
48 ; CHECK-DAG: vl [[REG3:%v[0-9]+]], 0(%r4)
49 ; CHECK: wfnmaxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], [[REG3]]
50 ; CHECK: vst [[RES]], 0(%r5)
52 %f1 = load fp128, ptr %ptr1
53 %f2 = load fp128, ptr %ptr2
54 %f3 = load fp128, ptr %ptr3
55 %res = call fp128 @llvm.experimental.constrained.fma.f128 (
56 fp128 %f1, fp128 %f2, fp128 %f3,
57 metadata !"round.dynamic",
58 metadata !"fpexcept.strict") #0
59 %negres = fsub fp128 0xL00000000000000008000000000000000, %res
60 store fp128 %negres, ptr %dst
64 define void @f4(ptr %ptr1, ptr %ptr2, ptr %ptr3, ptr %dst) #0 {
66 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
67 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
68 ; CHECK-DAG: vl [[REG3:%v[0-9]+]], 0(%r4)
69 ; CHECK: wfnmsxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], [[REG3]]
70 ; CHECK: vst [[RES]], 0(%r5)
72 %f1 = load fp128, ptr %ptr1
73 %f2 = load fp128, ptr %ptr2
74 %f3 = load fp128, ptr %ptr3
75 %neg = fsub fp128 0xL00000000000000008000000000000000, %f3
76 %res = call fp128 @llvm.experimental.constrained.fma.f128 (
77 fp128 %f1, fp128 %f2, fp128 %neg,
78 metadata !"round.dynamic",
79 metadata !"fpexcept.strict") #0
80 %negres = fsub fp128 0xL00000000000000008000000000000000, %res
81 store fp128 %negres, ptr %dst
85 attributes #0 = { strictfp }