1 ; Test strict vector maximum on z14.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
5 declare double @llvm.experimental.constrained.maxnum.f64(double, double, metadata, metadata)
6 declare <2 x double> @llvm.experimental.constrained.maxnum.v2f64(<2 x double>, <2 x double>, metadata, metadata)
8 declare float @llvm.experimental.constrained.maxnum.f32(float, float, metadata, metadata)
9 declare <4 x float> @llvm.experimental.constrained.maxnum.v4f32(<4 x float>, <4 x float>, metadata, metadata)
11 declare fp128 @llvm.experimental.constrained.maxnum.f128(fp128, fp128, metadata, metadata)
13 ; Test the f64 maxnum intrinsic.
14 define double @f1(double %dummy, double %val1, double %val2) {
16 ; CHECK: wfmaxdb %f0, %f2, %f4, 4
18 %ret = call double @llvm.experimental.constrained.maxnum.f64(
19 double %val1, double %val2,
20 metadata !"round.dynamic",
21 metadata !"fpexcept.strict")
25 ; Test the v2f64 maxnum intrinsic.
26 define <2 x double> @f2(<2 x double> %dummy, <2 x double> %val1,
29 ; CHECK: vfmaxdb %v24, %v26, %v28, 4
31 %ret = call <2 x double> @llvm.experimental.constrained.maxnum.v2f64(
32 <2 x double> %val1, <2 x double> %val2,
33 metadata !"round.dynamic",
34 metadata !"fpexcept.strict")
38 ; Test the f32 maxnum intrinsic.
39 define float @f3(float %dummy, float %val1, float %val2) {
41 ; CHECK: wfmaxsb %f0, %f2, %f4, 4
43 %ret = call float @llvm.experimental.constrained.maxnum.f32(
44 float %val1, float %val2,
45 metadata !"round.dynamic",
46 metadata !"fpexcept.strict")
50 ; Test the v4f32 maxnum intrinsic.
51 define <4 x float> @f4(<4 x float> %dummy, <4 x float> %val1,
54 ; CHECK: vfmaxsb %v24, %v26, %v28, 4
56 %ret = call <4 x float> @llvm.experimental.constrained.maxnum.v4f32(
57 <4 x float> %val1, <4 x float> %val2,
58 metadata !"round.dynamic",
59 metadata !"fpexcept.strict")
63 ; Test the f128 maxnum intrinsic.
64 define void @f5(fp128 *%ptr1, fp128 *%ptr2, fp128 *%dst) {
66 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
67 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
68 ; CHECK: wfmaxxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], 4
69 ; CHECK: vst [[RES]], 0(%r4)
71 %val1 = load fp128, fp128* %ptr1
72 %val2 = load fp128, fp128* %ptr2
73 %res = call fp128 @llvm.experimental.constrained.maxnum.f128(
74 fp128 %val1, fp128 %val2,
75 metadata !"round.dynamic",
76 metadata !"fpexcept.strict")
77 store fp128 %res, fp128* %dst