1 ; Test strict vector minimum on z14.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
5 declare double @llvm.experimental.constrained.minnum.f64(double, double, metadata, metadata)
6 declare <2 x double> @llvm.experimental.constrained.minnum.v2f64(<2 x double>, <2 x double>, metadata, metadata)
8 declare float @llvm.experimental.constrained.minnum.f32(float, float, metadata, metadata)
9 declare <4 x float> @llvm.experimental.constrained.minnum.v4f32(<4 x float>, <4 x float>, metadata, metadata)
11 declare fp128 @llvm.experimental.constrained.minnum.f128(fp128, fp128, metadata, metadata)
13 ; Test the f64 minnum intrinsic.
14 define double @f1(double %dummy, double %val1, double %val2) {
16 ; CHECK: wfmindb %f0, %f2, %f4, 4
18 %ret = call double @llvm.experimental.constrained.minnum.f64(
19 double %val1, double %val2,
20 metadata !"round.dynamic",
21 metadata !"fpexcept.strict")
25 ; Test the v2f64 minnum intrinsic.
26 define <2 x double> @f2(<2 x double> %dummy, <2 x double> %val1,
29 ; CHECK: vfmindb %v24, %v26, %v28, 4
31 %ret = call <2 x double> @llvm.experimental.constrained.minnum.v2f64(
32 <2 x double> %val1, <2 x double> %val2,
33 metadata !"round.dynamic",
34 metadata !"fpexcept.strict")
38 ; Test the f32 minnum intrinsic.
39 define float @f3(float %dummy, float %val1, float %val2) {
41 ; CHECK: wfminsb %f0, %f2, %f4, 4
43 %ret = call float @llvm.experimental.constrained.minnum.f32(
44 float %val1, float %val2,
45 metadata !"round.dynamic",
46 metadata !"fpexcept.strict")
50 ; Test the v4f32 minnum intrinsic.
51 define <4 x float> @f4(<4 x float> %dummy, <4 x float> %val1,
54 ; CHECK: vfminsb %v24, %v26, %v28, 4
56 %ret = call <4 x float> @llvm.experimental.constrained.minnum.v4f32(
57 <4 x float> %val1, <4 x float> %val2,
58 metadata !"round.dynamic",
59 metadata !"fpexcept.strict")
63 ; Test the f128 minnum 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: wfminxb [[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.minnum.f128(
74 fp128 %val1, fp128 %val2,
75 metadata !"round.dynamic",
76 metadata !"fpexcept.strict")
77 store fp128 %res, fp128* %dst